結果
| 問題 | No.1687 What the Heck? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-13 22:36:19 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 413 ms / 2,000 ms |
| コード長 | 193 bytes |
| 記録 | |
| コンパイル時間 | 551 ms |
| コンパイル使用メモリ | 85,320 KB |
| 実行使用メモリ | 129,404 KB |
| 最終ジャッジ日時 | 2026-05-13 22:36:26 |
| 合計ジャッジ時間 | 4,527 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
b=[];c=0
for i in range(n):
b.append((a[i],i+1))
c+=i+1
b.sort(reverse=True)
ans=0
for i,j in b:
c-=j
ans=max(ans,c-j)
print(ans)