結果

問題 No.1831 Parasol
ユーザー neterukunneterukun
提出日時 2022-02-04 22:16:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 439 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 79,352 KB
最終ジャッジ日時 2023-09-02 05:00:13
合計ジャッジ時間 3,937 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,344 KB
testcase_01 AC 111 ms
79,352 KB
testcase_02 AC 70 ms
71,312 KB
testcase_03 AC 69 ms
71,224 KB
testcase_04 AC 108 ms
79,320 KB
testcase_05 AC 71 ms
71,448 KB
testcase_06 AC 73 ms
71,200 KB
testcase_07 AC 108 ms
79,288 KB
testcase_08 AC 70 ms
71,460 KB
testcase_09 AC 72 ms
71,528 KB
testcase_10 AC 104 ms
78,468 KB
testcase_11 AC 111 ms
79,232 KB
testcase_12 AC 96 ms
78,036 KB
testcase_13 AC 110 ms
79,212 KB
testcase_14 AC 85 ms
76,776 KB
testcase_15 AC 87 ms
76,748 KB
testcase_16 AC 72 ms
71,176 KB
testcase_17 AC 72 ms
71,200 KB
testcase_18 AC 86 ms
76,724 KB
testcase_19 AC 71 ms
71,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())


ans = [[] for i in range(2 * n - 1)]
for val in reversed(range(2 * n - n + 1, 2 * n)):
    for i in range(val):
        ans[i].append(val)

idx = 0
for val in reversed(range(1, 2 * n - n + 1)):
    rev = -1
    for i in range(val):
        if i < 2:
            ans[idx].append(val)
            idx += 1
        else:
            ans[rev].append(val)
            rev -= 1

print(len(ans))
for res in ans:
    print(*res)
0