Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97436 孙睿阳 百钱买百鸡II C++ Accepted 239 MS 276 KB 341 2024-11-15 21:25:53

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,m=0; cin>>n; int x,y,z; for(x=0;x<=n/5;x++){ for(y=0;y<=n/3;y++){ for(z=0;z<=n;z++){ if(z%3==0&&n==(5*x)+(3*y)+(z/3)&&n==x+y+z){ m++; printf("%d: %d,%d,%d\n",m,x,y,z); } } } } if(m==0){ cout<<"None"; } return 0; }