結果

問題 No.1402 ビル街
ユーザー umezoumezo
提出日時 2021-02-19 23:55:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 205,608 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 00:41:04
合計ジャッジ時間 8,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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(){
  int n;
  cin>>n;
  
  vector<int> A(n+2,1);
  A[0]=2000000000;
  A[n+1]=2000000000;
    
  int now=(n+2)/2;
  int plus=1;
  
  for(int i=1;i<=n;i++){
    A[now]+=plus;
    if(i%2==1) now-=i;
    else now+=i;
    plus++;
  }
  
  rep(i,n+2){
    if(i) cout<<" ";
    cout<<A[i];
  }
  cout<<endl;

  return 0;
}
0