結果
| 問題 | No.1619 Coccinellidae | 
| コンテスト | |
| ユーザー |  umezo | 
| 提出日時 | 2021-07-22 22:17:30 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 122 ms / 2,000 ms | 
| コード長 | 570 bytes | 
| コンパイル時間 | 1,832 ms | 
| コンパイル使用メモリ | 195,016 KB | 
| 最終ジャッジ日時 | 2025-01-23 06:54:01 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 16 | 
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  ll n,m,k;
  cin>>n>>m>>k;
  
  vector<ll> A(n);
  int l=0,r=n-1;
  ll res=k,sum=m;
  rep(i,n){
    ll now=n-1-i;
    if(k>=now){
      k-=now;
      sum-=i;
      A[r]=i;
      if(i==n-1) A[r]+=sum;
      r--;
    }
    else{
      sum-=i;
      A[l]=i;
      if(i==n-1) A[l]+=sum;
      l++;
    }
  }
  rep(i,n) cout<<A[i]<<endl;
  
  return 0;
}
            
            
            
        