結果
| 問題 | No.2710 How many more? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-04 12:27:02 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 360 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 47,832 KB |
| 最終ジャッジ日時 | 2026-09-07 01:53:08 |
| 合計ジャッジ時間 | 10,013 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 12 |
ソースコード
N,Q=map(int,input().split())
A=list(map(int,input().split()))
from collections import defaultdict
D=defaultdict(list)
for i,a in enumerate(A,1):
D[a].append(i)
D=sorted(D.items())
P={}
for i,L in enumerate(D,1):
for p in L[1]:
P[p]=i
for _ in range(Q):
x,y=map(int,input().split())
if P[x]-P[y]-1>0:print(P[x]-P[y]-1)
else:print(0)