結果

問題 No.1831 Parasol
ユーザー KudeKude
提出日時 2022-02-04 22:44:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 79,244 KB
最終ジャッジ日時 2023-09-02 05:14:30
合計ジャッジ時間 3,914 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,472 KB
testcase_01 AC 152 ms
79,128 KB
testcase_02 AC 75 ms
71,384 KB
testcase_03 AC 76 ms
70,980 KB
testcase_04 AC 119 ms
79,244 KB
testcase_05 AC 75 ms
71,372 KB
testcase_06 AC 76 ms
71,324 KB
testcase_07 AC 119 ms
78,940 KB
testcase_08 AC 77 ms
71,236 KB
testcase_09 AC 78 ms
71,268 KB
testcase_10 AC 112 ms
78,420 KB
testcase_11 AC 123 ms
79,204 KB
testcase_12 AC 105 ms
78,012 KB
testcase_13 AC 122 ms
78,812 KB
testcase_14 AC 93 ms
76,572 KB
testcase_15 AC 97 ms
76,648 KB
testcase_16 AC 78 ms
70,980 KB
testcase_17 AC 77 ms
71,432 KB
testcase_18 AC 95 ms
76,612 KB
testcase_19 AC 75 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = 2 * n - 1
ans = [[] for _ in range(m)]
l = 1
r = m + 1
while l < r:
    cnt = r - l
    if cnt == 1:
        ans[0].append(l)
        break
    mx = r - 1
    for i in range(cnt):
        ans[i].append(mx)
    nxt = l + 2
    ans[cnt - 1].append(l)
    for i in range(cnt // 2 - 1):
        ans[cnt - 1].append(l + 2 + i)
    ans[cnt - 2].append(l + 1)
    for i in range(cnt // 2 - 1):
        ans[cnt - 2].append(l + 2 + cnt // 2 - 1 + i)
    l += 1
    r -= 1
print(m)
for a in ans:
    print(*a)
0