Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
132065 黄俊然 百钱买百鸡II C++ Accepted 3 MS 280 KB 612 2025-10-05 10:39:23

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,sum=0; cin>>N; for(int i=0;i<=N/5;i++) { for (int j=0;j<=(N-5*i)/3;j++) { int z=N-i-j; if (z%3==0 && 5*i+3*j+z/3==N){ sum++; cout<<sum<<": "<<i<<","<<j<<","<<z<<endl; } } } if (sum==0){ cout<<"None"<<endl; } return 0; }