結果
問題 | No.77 レンガのピラミッド |
ユーザー | gorugo30 |
提出日時 | 2021-02-26 17:31:55 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 55 ms / 5,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 202 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 64,272 KB |
最終ジャッジ日時 | 2024-04-10 07:26:47 |
合計ジャッジ時間 | 2,241 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 39 ms
53,116 KB |
testcase_01 | AC | 38 ms
52,032 KB |
testcase_02 | AC | 39 ms
52,960 KB |
testcase_03 | AC | 37 ms
52,564 KB |
testcase_04 | AC | 37 ms
53,076 KB |
testcase_05 | AC | 38 ms
53,136 KB |
testcase_06 | AC | 55 ms
64,272 KB |
testcase_07 | AC | 38 ms
53,560 KB |
testcase_08 | AC | 50 ms
62,704 KB |
testcase_09 | AC | 46 ms
60,416 KB |
testcase_10 | AC | 45 ms
59,784 KB |
testcase_11 | AC | 45 ms
61,200 KB |
testcase_12 | AC | 49 ms
61,852 KB |
testcase_13 | AC | 51 ms
63,108 KB |
testcase_14 | AC | 50 ms
62,656 KB |
testcase_15 | AC | 43 ms
60,696 KB |
testcase_16 | AC | 39 ms
53,408 KB |
testcase_17 | AC | 39 ms
52,216 KB |
testcase_18 | AC | 50 ms
61,848 KB |
testcase_19 | AC | 40 ms
52,992 KB |
testcase_20 | AC | 38 ms
52,680 KB |
testcase_21 | AC | 48 ms
61,036 KB |
testcase_22 | AC | 44 ms
58,672 KB |
testcase_23 | AC | 48 ms
62,032 KB |
testcase_24 | AC | 38 ms
52,096 KB |
ソースコード
N = int(input()) A = list(map(int, input().split())) height = 1 ans = 190000190129219 while height * height <= sum(A): targ = [min(i + 1, 2 * height - 1 - i) for i in range(2 * height - 1)] sute = 0 for i in range(2 * height - 1): if i < N: a = A[i] else: a = 0 if a > targ[i]: sute += a - targ[i] for i in range(2 * height - 1, N): sute += A[i] ans = min(ans, sute) height += 1 print(ans)