結果

問題 No.3085 Easy Problems
ユーザー nikoro256
提出日時 2025-04-04 21:28:28
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 453 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 156,048 KB
最終ジャッジ日時 2025-04-08 03:11:12
合計ジャッジ時間 60,642 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
input = sys.stdin.readline
N=int(input())
qs=[]
for _ in range(N):
    a,b=map(int, input().split())
    qs.append((a,0,b))
Q=int(input())
for i in range(Q):
    x,y=map(int, input().split())
    qs.append((x,1,y,i))
count = 0
dic =defaultdict(int)
ans=[0]*Q
qs.sort()
for q in qs:
    if q[1]==0:
        count+=1
        dic[q[2]]+=1
    else:
        ans[q[3]]=count-dic[q[2]]
for a in ans:
    print(a)
0