結果

問題 No.1687 What the Heck?
ユーザー とりゐとりゐ
提出日時 2021-09-24 21:28:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 593 ms / 2,000 ms
コード長 187 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 107,792 KB
最終ジャッジ日時 2023-09-18 20:41:38
合計ジャッジ時間 6,649 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,328 KB
testcase_01 AC 72 ms
71,236 KB
testcase_02 AC 71 ms
71,396 KB
testcase_03 AC 75 ms
71,376 KB
testcase_04 AC 70 ms
71,288 KB
testcase_05 AC 72 ms
71,096 KB
testcase_06 AC 70 ms
71,264 KB
testcase_07 AC 239 ms
91,408 KB
testcase_08 AC 313 ms
98,900 KB
testcase_09 AC 244 ms
91,140 KB
testcase_10 AC 178 ms
85,888 KB
testcase_11 AC 186 ms
86,168 KB
testcase_12 AC 593 ms
107,556 KB
testcase_13 AC 586 ms
107,652 KB
testcase_14 AC 583 ms
107,572 KB
testcase_15 AC 587 ms
107,600 KB
testcase_16 AC 590 ms
107,528 KB
testcase_17 AC 103 ms
77,700 KB
testcase_18 AC 578 ms
107,792 KB
testcase_19 AC 79 ms
76,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  b.append((a[i],i+1))
b.sort()
ans=0
tmp=0
for i in range(n):
  ans=max(ans,tmp-b[i][1])
  tmp+=b[i][1]
print(ans)
0