Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96815 | 王思颜 | 百钱买百鸡II | C++ | Wrong Answer | 6 MS | 272 KB | 394 | 2024-11-09 16:09:33 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s = 0; cin>>n; for (int x = 1;x <= n / 5;x++){ for (int y = 1;y <= n / 3;y++){ for (int z = 1;z <= n / 1;z++){ if (x + y + z == n && 5 * x + 3 * y == n){ cout<<"第"<<x<<"种方案"<<":"<<x<<","<<y<<","<<z<<endl; s = 1; } } } } if (s == 0){ cout<<"None"; } return 0; }
------Input------
550
------Answer-----
1: 2,134,414 2: 6,127,417 3: 10,120,420 4: 14,113,423 5: 18,106,426 6: 22,99,429 7: 26,92,432 8: 30,85,435 9: 34,78,438 10: 38,71,441 11: 42,64,444 12: 46,57,447 13: 50,50,450 14: 54,43,453 15: 58,36,456 16: 62,29,459 17: 66,22,462 18: 70,15,465 19: 74,8,468 20: 78,1,471
------Your output-----
第2种方案:2,180,368 第5种方案:5,175,370 第8种方案:8,170,372 第11种方案:11,165,374 第14种方案:14,160,376 第17种方案:17,155,378 第20种方案:20,150,380 第23种方案:23,145,382 第26种方案:26,140,384 第29种方案:29,135,386 第32种方案:32,130,388 第35种方案:35,125,390 第38种方案:38,120,392 第41种方案:41,115,394 第44种方案:44,110,396 第47种方案:47,105,398 第50种方案:50,100,400 第53种方案:53,95,402 第56种方案:56,90,404 第59种方案