結果
| 問題 | No.2710 How many more? |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-03-31 14:05:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 305 ms / 2,000 ms |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 404 ms |
| コンパイル使用メモリ | 85,524 KB |
| 実行使用メモリ | 96,768 KB |
| 最終ジャッジ日時 | 2026-04-16 20:52:18 |
| 合計ジャッジ時間 | 5,637 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()))
sorted_A = sorted(A)
for _ in range(Q):
x, y = map(lambda x: int(x) - 1, input().split())
print(max(bisect_left(sorted_A, A[x]) - bisect_right(sorted_A, A[y]), 0))