結果

問題 No.1587 012 Matrix
ユーザー tktk_snsntktk_snsn
提出日時 2021-07-08 22:50:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 148 ms / 1,000 ms
コード長 284 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 11,048 KB
最終ジャッジ日時 2023-09-14 05:22:27
合計ジャッジ時間 2,835 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,864 KB
testcase_01 AC 18 ms
7,796 KB
testcase_02 AC 17 ms
7,836 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 16 ms
7,936 KB
testcase_05 AC 16 ms
7,888 KB
testcase_06 AC 16 ms
7,796 KB
testcase_07 AC 16 ms
7,836 KB
testcase_08 AC 17 ms
7,856 KB
testcase_09 AC 18 ms
8,264 KB
testcase_10 AC 20 ms
8,800 KB
testcase_11 AC 31 ms
8,964 KB
testcase_12 AC 35 ms
9,244 KB
testcase_13 AC 48 ms
9,440 KB
testcase_14 AC 67 ms
9,484 KB
testcase_15 AC 86 ms
9,816 KB
testcase_16 AC 105 ms
10,196 KB
testcase_17 AC 125 ms
10,528 KB
testcase_18 AC 135 ms
10,748 KB
testcase_19 AC 143 ms
10,752 KB
testcase_20 AC 148 ms
10,940 KB
testcase_21 AC 148 ms
11,048 KB
testcase_22 AC 16 ms
7,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = [[0] * n for _ in range(n)]
for i in range(n):
    for j in range(n):
        if i+j < n-1:
            ans[i][j] = 2
for i in range(n):
    j = n-i-1
    if j % 2 == 0:
        ans[i][j] = 1
    else:
        ans[i][j] = 2

for a in ans:
    print(*a, sep="")
0