結果

問題 No.1587 012 Matrix
ユーザー ayaoniayaoni
提出日時 2021-07-08 22:38:58
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 115 ms / 1,000 ms
コード長 809 bytes
コンパイル時間 284 ms
使用メモリ 83,336 KB
最終ジャッジ日時 2023-02-01 18:48:32
合計ジャッジ時間 4,436 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 88 ms
75,772 KB
testcase_01 AC 88 ms
75,416 KB
testcase_02 AC 88 ms
75,772 KB
testcase_03 AC 89 ms
75,736 KB
testcase_04 AC 89 ms
75,716 KB
testcase_05 AC 88 ms
75,504 KB
testcase_06 AC 89 ms
75,764 KB
testcase_07 AC 88 ms
75,640 KB
testcase_08 AC 92 ms
80,480 KB
testcase_09 AC 93 ms
80,476 KB
testcase_10 AC 95 ms
80,464 KB
testcase_11 AC 98 ms
80,920 KB
testcase_12 AC 99 ms
80,948 KB
testcase_13 AC 100 ms
80,536 KB
testcase_14 AC 103 ms
80,732 KB
testcase_15 AC 105 ms
80,512 KB
testcase_16 AC 106 ms
80,908 KB
testcase_17 AC 109 ms
82,932 KB
testcase_18 AC 110 ms
83,156 KB
testcase_19 AC 112 ms
83,268 KB
testcase_20 AC 115 ms
83,336 KB
testcase_21 AC 114 ms
83,132 KB
testcase_22 AC 87 ms
75,528 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