結果

問題 No.1587 012 Matrix
ユーザー ayaoniayaoni
提出日時 2021-07-08 22:38:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 1,000 ms
コード長 809 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 78,868 KB
最終ジャッジ日時 2023-09-14 05:13:45
合計ジャッジ時間 3,470 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,344 KB
testcase_01 AC 69 ms
71,140 KB
testcase_02 AC 70 ms
71,396 KB
testcase_03 AC 73 ms
71,156 KB
testcase_04 AC 68 ms
71,280 KB
testcase_05 AC 71 ms
71,112 KB
testcase_06 AC 70 ms
71,160 KB
testcase_07 AC 71 ms
71,456 KB
testcase_08 AC 73 ms
75,892 KB
testcase_09 AC 73 ms
75,740 KB
testcase_10 AC 75 ms
75,980 KB
testcase_11 AC 78 ms
76,380 KB
testcase_12 AC 78 ms
76,184 KB
testcase_13 AC 79 ms
76,604 KB
testcase_14 AC 80 ms
76,332 KB
testcase_15 AC 82 ms
76,272 KB
testcase_16 AC 83 ms
76,272 KB
testcase_17 AC 85 ms
76,328 KB
testcase_18 AC 94 ms
78,516 KB
testcase_19 AC 89 ms
78,784 KB
testcase_20 AC 92 ms
78,816 KB
testcase_21 AC 90 ms
78,868 KB
testcase_22 AC 68 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N = I()
M = N//2

ANS = [[0]*N for _ in range(N)]
for i in range(M):
    ANS[2*i][2*i+1] = 1
    ANS[2*i+1][2*i] = 2
    ANS[2*i+1][2*i+1] = 2
    for j in range(i):
        ANS[2*i][2*j] = 2
        ANS[2*i+1][2*j] = 2
        ANS[2*i][2*j+1] = 2
        ANS[2*i+1][2*j+1] = 2

for i in range(N):
    ans = ''.join([str(a) for a in ANS[i]])
    print(ans)
0