結果

問題 No.1587 012 Matrix
ユーザー shinichishinichi
提出日時 2021-07-08 22:57:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 1,000 ms
コード長 547 bytes
コンパイル時間 513 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 79,624 KB
最終ジャッジ日時 2023-09-14 05:25:51
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,464 KB
testcase_01 AC 75 ms
71,572 KB
testcase_02 AC 75 ms
71,480 KB
testcase_03 AC 78 ms
71,376 KB
testcase_04 AC 80 ms
71,376 KB
testcase_05 AC 76 ms
71,384 KB
testcase_06 AC 80 ms
71,504 KB
testcase_07 AC 79 ms
71,236 KB
testcase_08 AC 83 ms
76,504 KB
testcase_09 AC 81 ms
76,548 KB
testcase_10 AC 82 ms
76,452 KB
testcase_11 AC 83 ms
76,524 KB
testcase_12 AC 84 ms
76,220 KB
testcase_13 AC 89 ms
76,848 KB
testcase_14 AC 90 ms
76,804 KB
testcase_15 AC 95 ms
78,236 KB
testcase_16 AC 99 ms
78,764 KB
testcase_17 AC 101 ms
78,796 KB
testcase_18 AC 102 ms
79,624 KB
testcase_19 AC 102 ms
79,316 KB
testcase_20 AC 105 ms
79,376 KB
testcase_21 AC 103 ms
79,352 KB
testcase_22 AC 75 ms
71,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
result = [[None]*n for _ in range(n)]
ans = []
array = set(range(1, 2*n+1)) - set([2+4*n for n in range(2*n)]) - set([3+4*n for n in range(2*n)])
array = sorted(list(array))
j = 0
for line in result:
    now = array[j]
    j += 1
    tmp = now
    alt = []
    for i in range(n):
        if tmp >= 2:
            alt.append(2)
            tmp -= 2
        elif tmp == 1:
            alt.append(1)
            tmp -= 1
        else:
            alt.append(0)
    ans.append(''.join(map(str, reversed(alt))))


print(*ans, sep='\n')
0