結果

問題 No.1587 012 Matrix
ユーザー SSRSSSRS
提出日時 2021-07-08 22:32:00
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 355 bytes
コンパイル時間 1,394 ms
使用メモリ 3,544 KB
最終ジャッジ日時 2023-02-01 18:41:11
合計ジャッジ時間 3,070 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,440 KB
testcase_01 AC 2 ms
3,440 KB
testcase_02 AC 2 ms
3,524 KB
testcase_03 AC 2 ms
3,516 KB
testcase_04 AC 2 ms
3,376 KB
testcase_05 AC 1 ms
3,468 KB
testcase_06 AC 2 ms
3,440 KB
testcase_07 AC 2 ms
3,476 KB
testcase_08 AC 2 ms
3,544 KB
testcase_09 AC 2 ms
3,516 KB
testcase_10 AC 2 ms
3,432 KB
testcase_11 AC 2 ms
3,528 KB
testcase_12 AC 3 ms
3,468 KB
testcase_13 AC 5 ms
3,528 KB
testcase_14 AC 7 ms
3,364 KB
testcase_15 AC 9 ms
3,368 KB
testcase_16 AC 11 ms
3,472 KB
testcase_17 AC 12 ms
3,516 KB
testcase_18 AC 14 ms
3,512 KB
testcase_19 AC 14 ms
3,444 KB
testcase_20 AC 15 ms
3,524 KB
testcase_21 AC 15 ms
3,544 KB
testcase_22 AC 1 ms
3,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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