3 条题解

  • 0
    @ 2026-2-7 19:43:28
    #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;
    }
    
    

    信息

    ID
    6877
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    50
    已通过
    15
    上传者