結果

問題 No.1831 Parasol
ユーザー 👑 rin204rin204
提出日時 2022-02-05 18:49:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 79,464 KB
最終ジャッジ日時 2023-09-02 06:50:22
合計ジャッジ時間 3,836 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,244 KB
testcase_01 AC 115 ms
79,032 KB
testcase_02 AC 69 ms
71,564 KB
testcase_03 AC 68 ms
71,328 KB
testcase_04 AC 110 ms
79,364 KB
testcase_05 AC 69 ms
71,440 KB
testcase_06 AC 70 ms
71,564 KB
testcase_07 AC 110 ms
79,136 KB
testcase_08 AC 71 ms
71,368 KB
testcase_09 AC 69 ms
71,304 KB
testcase_10 AC 102 ms
78,496 KB
testcase_11 AC 112 ms
79,228 KB
testcase_12 AC 95 ms
77,796 KB
testcase_13 AC 111 ms
79,464 KB
testcase_14 AC 84 ms
76,644 KB
testcase_15 AC 87 ms
76,800 KB
testcase_16 AC 71 ms
71,312 KB
testcase_17 AC 72 ms
71,480 KB
testcase_18 AC 86 ms
76,928 KB
testcase_19 AC 69 ms
71,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
print(2 * n - 1)
lst = [[] for _ in range(n)]

for i in range(n - 1):
    i1 = i + 1
    i2 = 2 * n - 1 - i1
    if i % 2 == 0:
        i1, i2 = i2, i1
    for _ in range(i1):
        lst[i].append(i1)
    for _ in range(i2):
        lst[i].append(i2)
    
lst[-1] = [2 * n - 1] * (2 * n - 1)

for row in zip(*lst):
    print(*row)
0