結果
| 問題 | No.1687 What the Heck? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-13 22:35:53 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 214 bytes |
| 記録 | |
| コンパイル時間 | 172 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 129,280 KB |
| 最終ジャッジ日時 | 2026-05-13 22:36:02 |
| 合計ジャッジ時間 | 4,712 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 WA * 1 |
ソースコード
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=-1<<60
if n==1:
ans=0
for i,j in b:
c-=j
ans=max(ans,c-j)
print(ans)