結果

問題 No.1831 Parasol
ユーザー puzneko
提出日時 2022-03-04 00:57:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,396 KB
実行使用メモリ 77,692 KB
最終ジャッジ日時 2024-07-17 21:32:28
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
upto = n*2-1
nokorimin = 1
ans = []
for i in range(n-1):
    next = [i for i in range(upto,n*2)]
    ind = nokorimin
    while ind < upto:
        next.append(ind)
        ind += 2
    ans.append(next)
    next = [i for i in range(upto,n*2)]
    ind = nokorimin + 1
    while ind < upto:
        next.append(ind)
        ind += 2
    ans.append(next)
    upto -= 1
    nokorimin += 1

next = [i for i in range(upto,n*2)]
ans.append(next)

print("{}".format(n*2-1))
for j in range(n*2-1):
    L=[str(i) for i in ans[j]]
    L=' '.join(L)
    print(L)
0