1 条评论

  • @ 2025-3-14 18:35:18

    赞同

    
    #include<bits/stdc++.h>
    #define ll long long
    #define R register
    #define F(i,a,b) for(int i = (a);i<=(b);i++)
    using namespace std;
    inline int read(){R int x=0,t=1;R char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-') t=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*t;}
    const int N=2e5+10;
    
    signed main()
    {
    	int n=read();
    	int x,y,z;
    	x=y=z=n/3;
    	z+=(x/2+y/2);
    	x/=2;
    	y/=2;
    //	cout << x << " " << y << " " << z << '\n';
    	y+=(x/2+z/2);
    	x/=2;
    	z/=2;
    //	cout << x << " " << y << " " << z << '\n';
    	x+=(y/2+z/2);
    	y/=2;
    	z/=2;
    	cout << x << " " << y << " " << z << '\n';
    	if(x+y+z!=n){
    		assert(0);
    	}
    	return 0;
    }
    /*
    
    */
    
    
    
    • 1

    信息

    ID
    538
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    递交数
    139
    已通过
    22
    上传者