結果
問題 | No.3085 Easy Problems |
ユーザー |
|
提出日時 | 2025-04-04 21:31:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,206 ms / 2,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 351 ms |
コンパイル使用メモリ | 82,248 KB |
実行使用メモリ | 106,868 KB |
最終ジャッジ日時 | 2025-04-04 21:33:36 |
合計ジャッジ時間 | 37,019 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 |
ソースコード
from bisect import *from collections import defaultdictn=int(input())type=defaultdict(list)lst=[]for i in range(n):har,ty=map(int,input().split())type[ty].append(har)lst.append(har)lst.sort()for i in range(1,10**5+1):type[i].sort()q=int(input())for _ in range(q):x,y=map(int,input().split())idx=bisect_right(lst,x)minus=bisect_right(type[y],x)print(idx-minus)