結果
問題 | No.2710 How many more? |
ユーザー |
|
提出日時 | 2024-07-10 20:10:42 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 319 bytes |
コンパイル時間 | 341 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 21,836 KB |
最終ジャッジ日時 | 2024-07-10 20:10:56 |
合計ジャッジ時間 | 11,579 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 17 |
ソースコード
from bisect import bisect_right, bisect_left n, q = map(int, input().split()) print(n, q) a = list(map(int, input().split())) s = sorted(a) for _ in [0]*q: x, y = map(int, input().split()) l = bisect_right(s, a[y-1]) r = bisect_left(s, a[x-1]) if r <= l: print(0) else: print(r - l)