結果
| 問題 | No.2710 How many more? |
| コンテスト | |
| ユーザー |
Cecil
|
| 提出日時 | 2024-03-31 14:47:08 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 703 ms / 2,000 ms |
| コード長 | 348 bytes |
| 記録 | |
| コンパイル時間 | 515 ms |
| コンパイル使用メモリ | 20,692 KB |
| 実行使用メモリ | 25,188 KB |
| 最終ジャッジ日時 | 2026-04-16 21:46:13 |
| 合計ジャッジ時間 | 9,996 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
import bisect
N,Q = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
A[i] *= -1
tmp_A = A.copy()
tmp_A.sort()
for _ in range(Q):
x,y = map(int, input().split())
l = bisect.bisect_right(tmp_A, A[x-1])
r = bisect.bisect_left(tmp_A, A[y-1])
if r-l<=0:
print(0)
else:
print(r-l)
Cecil