結果

問題 No.2710 How many more?
ユーザー hiro1729hiro1729
提出日時 2024-03-31 13:44:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 494 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,216 KB
最終ジャッジ日時 2024-03-31 13:44:54
合計ジャッジ時間 7,501 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,332 KB
testcase_01 AC 36 ms
53,332 KB
testcase_02 AC 416 ms
83,904 KB
testcase_03 AC 282 ms
84,060 KB
testcase_04 AC 228 ms
90,868 KB
testcase_05 AC 208 ms
81,872 KB
testcase_06 AC 207 ms
87,340 KB
testcase_07 AC 252 ms
77,252 KB
testcase_08 AC 219 ms
77,836 KB
testcase_09 AC 367 ms
87,292 KB
testcase_10 AC 264 ms
81,740 KB
testcase_11 AC 377 ms
80,104 KB
testcase_12 AC 449 ms
89,232 KB
testcase_13 AC 494 ms
91,216 KB
testcase_14 AC 494 ms
91,216 KB
testcase_15 AC 487 ms
91,216 KB
testcase_16 AC 476 ms
91,216 KB
testcase_17 AC 493 ms
91,212 KB
testcase_18 AC 37 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left as bs
N, Q = map(int, input().split())
A = list(map(int, input().split()))
B = sorted(A)
for _ in range(Q):
	x, y = map(int, input().split())
	print(max(0, bs(B, A[x - 1]) - bs(B, A[y - 1] + 1)))
0