結果

問題 No.2710 How many more?
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-04-05 14:01:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 458 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,604 KB
最終ジャッジ日時 2024-04-05 14:01:55
合計ジャッジ時間 7,129 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,332 KB
testcase_01 AC 33 ms
53,332 KB
testcase_02 AC 406 ms
84,172 KB
testcase_03 AC 293 ms
84,320 KB
testcase_04 AC 227 ms
91,132 KB
testcase_05 AC 190 ms
82,040 KB
testcase_06 AC 189 ms
87,604 KB
testcase_07 AC 234 ms
77,388 KB
testcase_08 AC 205 ms
78,256 KB
testcase_09 AC 377 ms
87,556 KB
testcase_10 AC 237 ms
81,896 KB
testcase_11 AC 324 ms
80,396 KB
testcase_12 AC 409 ms
89,500 KB
testcase_13 AC 439 ms
91,352 KB
testcase_14 AC 430 ms
91,604 KB
testcase_15 AC 458 ms
91,484 KB
testcase_16 AC 429 ms
91,604 KB
testcase_17 AC 427 ms
91,352 KB
testcase_18 AC 35 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
a=list(map(int,input().split()))
b=sorted(a)
from bisect import bisect_left,bisect_right
for i in range(q):
	x,y=map(int,input().split())
	x-=1
	y-=1
	print(max(0,bisect_left(b,a[x])-bisect_right(b,a[y])))
0