結果

問題 No.1831 Parasol
ユーザー Kude
提出日時 2022-02-04 22:44:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 77,952 KB
最終ジャッジ日時 2024-06-11 12:13:26
合計ジャッジ時間 2,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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