Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
8114 | 詹梓涵 | 百钱买百鸡II | C++ | Accepted | 550 MS | 264 KB | 730 | 2025-06-14 16:04:07 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a=1,b=0; cin>>n; for(int x=0;x<=n;x++){ for(int y=0;y<=n;y++){ for(int z=0;z<=n;z++){ if(x+y+z==n){ if(x*5+y*3+z/3==n&&z%3==0){ cout<<a<<":"<<" "<<x<<","<<y<<","<<z<<endl; a++; b++; } } } } } if(b==0){ cout<<"None"<<endl; } return 0; }