Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117934 罗子童 百钱买百鸡II C++ Accepted 37 MS 272 KB 645 2025-04-20 19:28:27

Tests(10/10):


Code:

#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,f=0; cin>>N; for(int a=0;a<=N/5;a++){ for(int b=0;b<=N/3;b++){ for(int c=0;c<=N/3;c++){ if(a+b+c*3==N && 5*a+3*b+c==N){ f++; cout<<f<<": "<<a<<","<<b<<","<<3*c<<endl; } } } } if(f==0) cout<<"None"; return 0; }