結果

問題 No.3085 Easy Problems
ユーザー 👑 rin204
提出日時 2025-04-04 21:23:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,099 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 82,112 KB
実行使用メモリ 96,672 KB
最終ジャッジ日時 2025-04-04 21:23:49
合計ジャッジ時間 32,824 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right

n = int(input())
all_ = []
A = [[] for _ in range(100010)]
for _ in range(n):
    a, b = map(int, input().split())
    all_.append(a)
    A[b].append(a)

all_.sort()
for i in range(100010):
    A[i].sort()

Q = int(input())
for _ in range(Q):
    x, y = map(int, input().split())
    ans = bisect_right(all_, x) - bisect_right(A[y], x)
    print(ans)
0