結果

問題 No.1587 012 Matrix
ユーザー shinichishinichi
提出日時 2021-07-08 22:57:50
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 111 ms / 1,000 ms
コード長 547 bytes
コンパイル時間 372 ms
使用メモリ 83,640 KB
最終ジャッジ日時 2023-02-01 19:03:49
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 82 ms
75,712 KB
testcase_01 AC 82 ms
75,788 KB
testcase_02 AC 81 ms
75,676 KB
testcase_03 AC 80 ms
75,428 KB
testcase_04 AC 81 ms
75,688 KB
testcase_05 AC 81 ms
75,932 KB
testcase_06 AC 81 ms
75,724 KB
testcase_07 AC 81 ms
75,816 KB
testcase_08 AC 86 ms
80,984 KB
testcase_09 AC 89 ms
80,780 KB
testcase_10 AC 90 ms
80,824 KB
testcase_11 AC 91 ms
80,672 KB
testcase_12 AC 93 ms
80,820 KB
testcase_13 AC 96 ms
80,724 KB
testcase_14 AC 100 ms
82,456 KB
testcase_15 AC 103 ms
82,476 KB
testcase_16 AC 106 ms
83,288 KB
testcase_17 AC 110 ms
83,432 KB
testcase_18 AC 110 ms
83,640 KB
testcase_19 AC 111 ms
83,484 KB
testcase_20 AC 111 ms
83,312 KB
testcase_21 AC 109 ms
83,544 KB
testcase_22 AC 81 ms
75,560 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