結果

問題 No.3085 Easy Problems
コンテスト
ユーザー vjudge1
提出日時 2026-01-03 18:26:54
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
WA  
実行時間 -
コード長 601 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 735 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 40,640 KB
最終ジャッジ日時 2026-01-03 18:27:43
合計ジャッジ時間 44,414 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 29 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import bisect

input = sys.stdin.readline

n = int(input())
difficulty = []
type_map = {}

for _ in range(n):
    a, b = map(int, input().split())
    difficulty.append(a)
    if b not in type_map:
        type_map[b] = []
    type_map[b].append(a)

difficulty.sort()

for k in type_map:
    type_map[k].sort()

q = int(input())

for _ in range(q):
    x, y = map(int, input().split())

    if x == 10**9:
        print(0)
        continue

    total = bisect.bisect_right(difficulty, x)
    blocked = bisect.bisect_right(type_map[y], x) if y in type_map else 0

    print(total - blocked)
0