結果
問題 |
No.1687 What the Heck?
|
ユーザー |
|
提出日時 | 2022-03-04 09:46:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 132 ms / 2,000 ms |
コード長 | 264 bytes |
コンパイル時間 | 162 ms |
コンパイル使用メモリ | 82,016 KB |
実行使用メモリ | 125,944 KB |
最終ジャッジ日時 | 2024-07-18 07:00:49 |
合計ジャッジ時間 | 3,006 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
N = int(input()) P = list(map(int,input().split())) import sys if N == 1: print(0) exit() ans = 0 point = 0 D = {v:i + 1 for i,v in enumerate(P)} for i in range(1,N): point += D[i] if point - D[i+1] > ans: ans = point - D[i+1] print(ans)