結果

問題 No.2710 How many more?
コンテスト
ユーザー Michirakara
提出日時 2024-03-31 13:51:42
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 233 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 321 ms
コンパイル使用メモリ 85,376 KB
実行使用メモリ 128,512 KB
最終ジャッジ日時 2026-04-16 20:28:44
合計ジャッジ時間 4,740 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,q=map(int,input().split())
a=[*map(int,input().split())]
dists=sorted(set(a))
dic=dict()
for i in range(len(dists)):
	dic[dists[i]]=i
for _ in range(q):
	x,y=map(int,input().split())
	x-=1
	y-=1
	print(max(0,dic[a[x]]-dic[a[y]]-1))
0