結果
| 問題 | No.1687 What the Heck? | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-09-26 08:35:09 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 231 bytes | 
| コンパイル時間 | 145 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 114,688 KB | 
| 最終ジャッジ日時 | 2024-07-05 15:34:52 | 
| 合計ジャッジ時間 | 2,183 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 WA * 1 | 
ソースコード
from itertools import accumulate N=int(input()) P=list(map(int,input().split())) idx=[-1]*N for i in range(N): idx[P[i]-1]=i+1 idx_acc=list(accumulate(idx)) ans=0 for i in range(2,N): ans=max(ans,idx_acc[i-1]-idx[i]) print(ans)
