結果

問題 No.1831 Parasol
ユーザー tamato
提出日時 2022-02-04 22:07:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2024-06-11 11:55:45
合計ジャッジ時間 2,583 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())

    print(2 * N - 1)
    ans = [[] for _ in range(2 * N - 1)]
    for i in range(2 * N - 1, N, -1):
        for j in range(i):
            ans[j].append(i)
    cnt = 0
    for i in range(N, 1, -1):
        ans[cnt].append(i)
        ans[cnt + 1].append(i)
        cnt += 2
        for j in range(i - 2):
            ans[-j - 1].append(i)
    ans[-1].append(1)
    for line in ans:
        print(*line)


if __name__ == '__main__':
    main()
0