結果

問題 No.77 レンガのピラミッド
ユーザー ytftytft
提出日時 2022-11-08 04:51:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 269 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 79,660 KB
最終ジャッジ日時 2023-09-28 16:25:49
合計ジャッジ時間 5,242 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,452 KB
testcase_01 AC 74 ms
71,624 KB
testcase_02 AC 74 ms
71,792 KB
testcase_03 AC 74 ms
71,456 KB
testcase_04 RE -
testcase_05 AC 74 ms
71,380 KB
testcase_06 RE -
testcase_07 AC 74 ms
71,692 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 AC 74 ms
71,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda:sys.stdin.readline().rstrip()
T=int(input())
N=list(map(int,input().split()))
M=int(pow(sum(N),0.5))
ans=0
for i in range(M):
	ans+=max(N[i]-i-1,0)
for i in range(M,2*M-1):
	ans+=max(N[i]+i-2*M+1,0)
for i in range(2*M-1,T):
	ans+=N[i]
print(ans)
0