結果

問題 No.1587 012 Matrix
ユーザー brthyyjpbrthyyjp
提出日時 2021-08-18 18:19:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 354 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 73,472 KB
最終ジャッジ日時 2024-04-19 23:51:12
合計ジャッジ時間 2,150 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,456 KB
testcase_01 AC 36 ms
51,968 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 36 ms
51,584 KB
testcase_04 AC 35 ms
51,840 KB
testcase_05 AC 35 ms
51,840 KB
testcase_06 AC 35 ms
51,328 KB
testcase_07 AC 34 ms
52,096 KB
testcase_08 AC 36 ms
58,112 KB
testcase_09 AC 39 ms
59,008 KB
testcase_10 AC 41 ms
59,648 KB
testcase_11 AC 46 ms
59,904 KB
testcase_12 AC 44 ms
61,184 KB
testcase_13 AC 47 ms
63,616 KB
testcase_14 AC 48 ms
65,536 KB
testcase_15 AC 50 ms
67,200 KB
testcase_16 AC 53 ms
68,864 KB
testcase_17 AC 55 ms
71,296 KB
testcase_18 AC 58 ms
72,448 KB
testcase_19 AC 57 ms
73,088 KB
testcase_20 AC 58 ms
73,216 KB
testcase_21 AC 55 ms
73,472 KB
testcase_22 AC 35 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = [[-1]*n for i in range(n)]

for i in range(n):
    for j in range(n):
        if i+j < n-1:
            S[i][j] = '0'
        elif i+j == n-1:
            if i <= n//2-1:
                S[i][j] = '1'
            else:
                S[i][j] = '2'
        else:
            S[i][j] = '2'
for i in range(n):
    print(''.join(S[i]))
0