2 条题解

  • 0
    @ 2026-4-19 16:16:23
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    ll k,a[55];
    int main(){
    	ios::sync_with_stdio(0);
    	cin.tie(0);
    	cin>>k;
    	int n=50;
    	cout<<n<<"\n";
    	for(int i=1;i<=n;i++){
    		a[i]=n-i+k/50;
    	}
    	for(int i=1;i<=k%50;i++){
    		a[i]++;
    	}
    	for(int i=1;i<=n;i++)cout<<a[i]<<" ";
    	return 0;
    }
    
    • 0
      @ 2026-4-19 16:11:25
      #include<bits/stdc++.h>
      using namespace std;
      #define int long long
      const int N=55;
      int a[N];
      signed main()
      {
      	int k;cin>>k;int n=50;
      	for(int i=1;i<=n;i++)a[i]=49+k/n;k%=n;
      	for(int i=1;i<=k;i++)
      	{
      		a[i]+=n;
      		for(int j=1;j<=n;j++)if(j!=i)a[j]--;
      	}
      	cout<<n<<'\n';
      	for(int i=1;i<=n;i++)cout<<a[i]<<' ';
      	return 0;
      }
      • 1

      信息

      ID
      9446
      时间
      2000ms
      内存
      256MiB
      难度
      10
      标签
      递交数
      3
      已通过
      3
      上传者