結果

問題 No.1831 Parasol
ユーザー shotoyooshotoyoo
提出日時 2022-02-04 23:43:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 645 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 78,772 KB
最終ジャッジ日時 2023-09-02 06:09:06
合計ジャッジ時間 3,606 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,160 KB
testcase_01 AC 95 ms
78,772 KB
testcase_02 AC 70 ms
71,344 KB
testcase_03 AC 70 ms
71,428 KB
testcase_04 AC 91 ms
78,716 KB
testcase_05 AC 70 ms
71,472 KB
testcase_06 AC 71 ms
71,436 KB
testcase_07 AC 89 ms
76,716 KB
testcase_08 AC 70 ms
71,540 KB
testcase_09 AC 71 ms
71,356 KB
testcase_10 AC 88 ms
76,748 KB
testcase_11 AC 93 ms
78,612 KB
testcase_12 AC 84 ms
76,536 KB
testcase_13 AC 90 ms
76,432 KB
testcase_14 AC 78 ms
76,332 KB
testcase_15 AC 81 ms
76,340 KB
testcase_16 AC 72 ms
71,404 KB
testcase_17 AC 71 ms
71,516 KB
testcase_18 AC 80 ms
76,316 KB
testcase_19 AC 72 ms
71,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO)
LI = lambda : list(map(int, input().split()))
sys.setrecursionlimit(3*10**5+10)

n = int(input())
ans = [[0]*n for _ in range(2*n-1)]
for i in range(n):
    for j in range(n+i):
        ans[j][i] = n+i
for i in range(n):
    ans[i][0] = i+1
for i in range(n, 2*n-1):
    for j in range(2*n-1-i):
        ans[i+j][j] = 2*n-i
print(len(ans))
for item in ans:
    write(" ".join(map(str, item)))
0