3 条题解
-
2
#include<bits/stdc++.h> using namespace std; int num[5],ans=0; int main(){ for(int i=0;i<5;i++) cin>>num[i]; for(int i=0;i<5;i++){ int t=num[i]/3; if(i==0) num[4]+=t; else num[i-1]+=t; if(i==4)n num[0]+=t; else num[i+1]+=t; ans+=num[i]%3; num[i]=t; } for(int i=0;i<5;i++) cout << num[i] << " "; cout<<endl<<ans<<endl; return 0; } -
0
#include<bits/stdc++.h> using namespace std; int num[5],ans=0; int main(){ for(int i=0;i<5;i++) cin>>num[i]; for(int i=0;i<5;i++){ int t=num[i]/3; if(i==0) num[4]+=t; else num[i-1]+=t; if(i==4) num[0]+=t; else num[i+1]+=t; ans+=num[i]%3; num[i]=t; } for(int i=0;i<5;i++) cout << num[i] << " "; cout<<endl<<ans<<endl; return 0; } -
0
#include<iostream> #include<cstdio> using namespace std; int main() { int a,b,c,d,e,aa,bb,cc,dd,ee,ansa,ansb,ansc,ansd,anse,ansy; cin>>a>>b>>c>>d>>e; aa=a; bb=aa/3+b; cc=bb/3+c; dd=cc/3+d; ee=dd/3+e+aa/3; ansa=ee/3+aa/3+bb/3; ansb=cc/3+bb/3; ansc=dd/3+cc/3; ansd=ee/3+dd/3; anse=ee/3; ansy=aa%3+bb%3+cc%3+dd%3+ee%3; printf("%d %d %d %d %d\n%d",ansa,ansb,ansc,ansd,anse,ansy); return 0; }
- 1
信息
- ID
- 6877
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 1
- 标签
- 递交数
- 50
- 已通过
- 15
- 上传者