結果
| 問題 |
No.2710 How many more?
|
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2024-04-11 02:09:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 296 ms / 2,000 ms |
| コード長 | 342 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,044 KB |
| 実行使用メモリ | 91,656 KB |
| 最終ジャッジ日時 | 2024-10-02 21:10:53 |
| 合計ジャッジ時間 | 5,828 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
from bisect import bisect_left, bisect_right
N, Q = map(int, input().split())
A = list(map(int, input().split()))
query = [list(map(int, input().split())) for _ in range(Q)]
S = sorted(A)
for i in range(Q):
x, y = query[i]
if A[x-1] <= A[y-1]:
print(0)
else:
print(bisect_left(S, A[x-1])-bisect_right(S, A[y-1]))
detteiuu