結果
問題 | No.77 レンガのピラミッド |
ユーザー |
|
提出日時 | 2014-11-25 21:45:07 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 643 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2025-01-03 02:34:40 |
合計ジャッジ時間 | 1,541 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 3 |
other | AC * 17 WA * 3 |
ソースコード
N = int(raw_input()) A = map(int, raw_input().split()) total = sum(A) c = 0 sub_total = 0 mn = total while sub_total < total: diff = 0 B = [0] * (max(N, c * 2)) for i, v in enumerate(A): B[i] = v for i in xrange(c): t = B[i] - (i + 1) if t > 0: diff += t for i in xrange(c, c * 2 - 1): if i >= len(B): print i, len(B), c t = B[i] - (2 * c - i - 1) if t > 0: diff += t for i in xrange(c * 2 - 1, N): diff += B[i] mn = min(diff, mn) c += 1 sub_total += c + (c - 1) print mn