1 条题解

  • 2
    @ 2025-11-28 16:12:19
    #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;
    }
    
    • 1

    信息

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