結果

問題 No.2710 How many more?
ユーザー 中村健人
提出日時 2024-11-01 21:29:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,976 KB
最終ジャッジ日時 2024-11-01 21:29:21
合計ジャッジ時間 10,905 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 1 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
A=list(map(int,input().split()))
A_idx=[i for i in range(N)]
A_idx.sort(key=lambda x:A[x])
x,y=[],[]
for _ in range(Q):
	a,b=map(int,input().split())
	print(max(A_idx[a-1]-A_idx[b-1]-1,0))
	

0