結果

問題 No.1831 Parasol
ユーザー taisii2
提出日時 2022-02-04 22:12:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 167,860 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 11:57:22
合計ジャッジ時間 2,648 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  cout<<2*N-1<<endl;
  vector<int>ans(N);
  for(int i=0;i<N;i++){
    ans[i]=N+i;
  }
  for(int i=0;i<2*N-1;i++){
    for(int j=0;j<N;j++){
      cout<<ans[j]<<" ";
    }
    cout<<endl;
    if(i%2==1){
      for(int j=0;j<(i+1)/2;j++){
        ans[j]--;
      }
    }
  }
}
0