結果

問題 No.1831 Parasol
ユーザー wolgnikwolgnik
提出日時 2022-02-04 22:18:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 79,240 KB
最終ジャッジ日時 2023-09-02 05:01:26
合計ジャッジ時間 3,794 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,216 KB
testcase_01 AC 138 ms
78,844 KB
testcase_02 AC 72 ms
71,300 KB
testcase_03 AC 71 ms
71,104 KB
testcase_04 AC 108 ms
79,004 KB
testcase_05 AC 72 ms
71,304 KB
testcase_06 AC 69 ms
71,304 KB
testcase_07 AC 106 ms
78,812 KB
testcase_08 AC 71 ms
71,156 KB
testcase_09 AC 71 ms
71,508 KB
testcase_10 AC 98 ms
78,372 KB
testcase_11 AC 105 ms
79,240 KB
testcase_12 AC 94 ms
77,876 KB
testcase_13 AC 104 ms
78,800 KB
testcase_14 AC 82 ms
76,520 KB
testcase_15 AC 87 ms
76,480 KB
testcase_16 AC 73 ms
71,464 KB
testcase_17 AC 74 ms
71,200 KB
testcase_18 AC 86 ms
76,720 KB
testcase_19 AC 72 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N = int(input())

res = [[0] * N for _ in range(2 * N - 1)]
def solve(n, l):
  global res
  if n == 1:
    res[0][0] = l
    return
  for i in range(2 * n): res[2 * n - 2 - (i & 1)][i >> 1] = l + i
  for i in range(2 * n - 1): res[i][n - 1] = l + 2 * n - 2
  #print(res)
  solve(n - 1, l + 1)

solve(N, 1)
print(2 * N - 1)
for r in res: print(*r)
0