結果

問題 No.77 レンガのピラミッド
ユーザー akitsugu777
提出日時 2019-08-20 15:39:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 229 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-06 12:26:45
合計ジャッジ時間 1,845 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))

s = sum(a)
t = int(s**0.5)
b = [i+1 for i in range(t)] + [i for i in range(t-1, 0, -1)]

c = 0
for i in range(min(len(a), len(b))):
    c += min(a[i], b[i])

d = s - c
print(d)
0