結果
| 問題 | No.77 レンガのピラミッド |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2014-11-25 21:50:32 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 566 bytes |
| 記録 | |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 77,308 KB |
| 最終ジャッジ日時 | 2025-12-03 13:18:09 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 3 |
| other | AC * 17 WA * 3 |
ソースコード
N = int(raw_input())
A = [0] * 10001
B = map(int, raw_input().split())
for i, v in enumerate(B):
A[i] = v
total = sum(A)
c = 0
sub_total = 0
mn = total
while sub_total < total:
diff = 0
for i in xrange(c):
t = A[i] - (i + 1)
if t > 0:
diff += t
for i in xrange(c, c * 2 - 1):
t = A[i] - (2 * c - i - 1)
if t > 0:
diff += t
for i in xrange(c * 2 - 1, N):
diff += A[i]
mn = min(diff, mn)
c += 1
sub_total += c + (c - 1)
print mn