結果

問題 No.2710 How many more?
ユーザー 茅ヶ崎裕太茅ヶ崎裕太
提出日時 2024-03-31 14:47:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 874 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 21,032 KB
最終ジャッジ日時 2024-03-31 14:47:54
合計ジャッジ時間 10,604 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,984 KB
testcase_01 AC 30 ms
9,984 KB
testcase_02 AC 788 ms
16,588 KB
testcase_03 AC 409 ms
16,952 KB
testcase_04 AC 258 ms
20,328 KB
testcase_05 AC 270 ms
15,140 KB
testcase_06 AC 234 ms
18,920 KB
testcase_07 AC 343 ms
10,752 KB
testcase_08 AC 253 ms
12,412 KB
testcase_09 AC 589 ms
18,376 KB
testcase_10 AC 348 ms
14,488 KB
testcase_11 AC 621 ms
13,732 KB
testcase_12 AC 841 ms
20,048 KB
testcase_13 AC 867 ms
21,032 KB
testcase_14 AC 874 ms
21,032 KB
testcase_15 AC 865 ms
21,032 KB
testcase_16 AC 854 ms
21,032 KB
testcase_17 AC 836 ms
21,032 KB
testcase_18 AC 29 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
H,Q=map(int,input().split())
A=list(map(int,input().split()))
L=sorted(A)

for i in range(Q):
    x,y=map(int,input().split())
    if A[x-1] <= A[y-1]:
        print(0)
        continue
    print(((bisect_left(L,A[x-1])-bisect(L,A[y-1]))))
    
0