結果

問題 No.3085 Easy Problems
ユーザー 回転
提出日時 2025-04-04 21:31:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 161,836 KB
最終ジャッジ日時 2025-04-04 21:33:49
合計ジャッジ時間 57,775 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 29 TLE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
all = []
for _ in range(N):
    a,b = list(map(int,input().split()))
    all.append((a,-1,b))
Q = int(input())
for i in range(Q):
    x,y = list(map(int,input().split()))
    all.append((x,i,y))
all.sort()

ans = [-1 for _ in range(Q)]
bunya = defaultdict(int)
prob_count = 0
for i in range(N+Q):
    a,c,b = all[i]
    if(c == -1):
        bunya[b] += 1
        prob_count += 1
    else:
        ans[c] = prob_count - bunya[b]

for i in ans:
    print(i)
0