結果

問題 No.1831 Parasol
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2022-02-04 22:45:10
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 79,164 KB
最終ジャッジ日時 2023-09-02 05:14:39
合計ジャッジ時間 3,570 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,544 KB
testcase_01 AC 106 ms
79,164 KB
testcase_02 AC 71 ms
71,604 KB
testcase_03 AC 68 ms
71,384 KB
testcase_04 AC 103 ms
79,080 KB
testcase_05 AC 69 ms
71,088 KB
testcase_06 AC 69 ms
71,440 KB
testcase_07 AC 105 ms
79,020 KB
testcase_08 AC 69 ms
71,244 KB
testcase_09 AC 69 ms
71,396 KB
testcase_10 AC 98 ms
78,760 KB
testcase_11 AC 104 ms
79,008 KB
testcase_12 AC 94 ms
77,916 KB
testcase_13 AC 105 ms
79,056 KB
testcase_14 AC 80 ms
76,728 KB
testcase_15 AC 82 ms
76,612 KB
testcase_16 AC 71 ms
71,480 KB
testcase_17 AC 70 ms
71,524 KB
testcase_18 AC 85 ms
76,604 KB
testcase_19 AC 72 ms
71,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

https://yukicoder.me/problems/no/1831

(2N-1 + 1) * (2N-1) / 2 枚
= N*(2N-1) 枚 ある

2N-1個作れるのでは?
と考えられる

"""

import sys
from sys import stdin

N = int(stdin.readline())

ans = [[2*N-1] for i in range(2*N-1)]

for i in range(1,N):

    rev = 2*N-1 - i

    if i % 2 == 0:
        put = [i] * i + [rev] * rev
    else:
        put = [rev] * rev + [i] * i

    for j in range(2*N-1):
        ans[j].append(put[j])

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