結果
問題 |
No.2710 How many more?
|
ユーザー |
![]() |
提出日時 | 2024-02-06 21:22:57 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 273 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 81,960 KB |
実行使用メモリ | 124,036 KB |
最終ジャッジ日時 | 2024-09-28 12:13:52 |
合計ジャッジ時間 | 6,049 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 WA * 12 |
ソースコード
n, q = map(int, input().split()) a = list(map(int, input().split())) ls = sorted(list(set(a)), reverse = True) idx = dict() for i in range(len(ls)): idx[ls[i]] = i for _ in range(q): x, y = map(lambda x: int(x)-1, input().split()) print(max(0, idx[a[y]]-idx[a[x]]-1))