Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
94252 | 刘轻松 | 百钱买百鸡II | C++ | Accepted | 45 MS | 272 KB | 330 | 2024-10-20 10:08:11 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; int x,y,z,c=1; cin>>n; for(x=0;x<=n/5;x++){ for(y=0;y<=n/3;y++){ for(z=0;z<=n;z++){ if(x+y+z==n && x*5+y*3+z*(1.0/3)==n){ printf("%d: %d,%d,%d\n",c,x,y,z); c++; } } } } if(c==1){ cout<<"None"; } return 0; }