結果
| 問題 |
No.77 レンガのピラミッド
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-05 08:19:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 5,000 ms |
| コード長 | 215 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 12,032 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2025-01-05 08:19:24 |
| 合計ジャッジ時間 | 2,529 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 |
ソースコード
import math
N = int(input())
A = list(map(int, input().split()))
total = sum(A)
tall = int(math.sqrt(total))
ans = 0
for i in range(N):
ans += max(0, A[i] - max(0, tall - abs((tall - 1) - i)))
print(ans)