Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
138580 翁思宸 百钱买百鸡II C++ Wrong Answer 1 MS 268 KB 1026 2025-11-28 18:35:07

Tests(0/10):


Code:

/* //1491 完美立方 #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int m=0,n=0,a=1,b=1,c=1,d=1; cin>>n; for(a=2;a<=n;a++){ for(b=2;b<=n;b++){ for(c=2;c<=n;c++){ for(d=2;d<=n;d++){ if(a*a*a==b*b*b+c*c*c+d*d*d && b<c && c<d){ cout<<"Cube = "<<a<<", Triple = ("<<b<<","<<c<<","<<d<<") "<<endl; } } } } } return 0; }*/ //1492 百钱买百鸡II #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int l=1,n=0,x=1,y=1,z=1; cin>>n; for(x=0;x<=n/5;x++){ for(y=0;y<=n/3;y++){ z=n-x-y; if(5*x+3*y+z/3==n && z%3==0){ cout<<l<<":"<<x<<","<<y<<","<<z<<endl; l++; } } } if(l==1){ cout<<"None"; } return 0; }


Run Info:

------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-----
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