Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6923 | 邓小龙 | 百钱买百鸡II | C++ | Wrong Answer | 0 MS | 264 KB | 619 | 2025-03-28 15:43:23 |
#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 m;//m钱 int cnt=0; cin>>m; for(int i=0;i<=m/5;i++){//公鸡 for(int j=0;j<=m/3;j++){//母鸡 for(int k =0;k<=m;k+=3){//小鸡 if(k%3==0 && (5*i+3*j+k/3) == m && i+j+k ==m){ cout<<++cnt<<":"<<i<<","<<j<<","<<k<<endl; } } } } return 0; }
------Input------
100
------Answer-----
1: 0,25,75 2: 4,18,78 3: 8,11,81 4: 12,4,84
------Your output-----
1:0,25,75 2:4,18,78 3:8,11,81 4:12,4,84