結果
| 問題 | No.2710 How many more? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-31 13:53:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 238 bytes |
| 記録 | |
| コンパイル時間 | 363 ms |
| コンパイル使用メモリ | 82,320 KB |
| 実行使用メモリ | 103,404 KB |
| 最終ジャッジ日時 | 2024-09-30 18:34:18 |
| 合計ジャッジ時間 | 8,677 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 11 |
ソースコード
n,Q=map(int,input().split())
A=list(map(int,input().split()))
for i in range(n):
A[i]=[A[i],i+1]
A.sort()
P={}
for i in range(n):
P[A[i][-1]]=i
for i in range(Q):
a,b=map(int,input().split())
print(max(0,P[a]-P[b]-1))