結果

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

ソースコード

diff #
raw source code

from collections import defaultdict
n = int(input())
challenges = []
for _ in range(n):
    a, b = map(int, input().split())
    challenges.append((a, b))
by_difficulty = defaultdict(lambda: defaultdict(int))
for difficulty, challenge_type in challenges:
    by_difficulty[difficulty][challenge_type] += 1

q = int(input())
for _ in range(q):
    x, y = map(int, input().split())
    if x == 1000000000:
        print(0)
        continue
    
    count = 0
    for difficulty, types_dict in by_difficulty.items():
        if difficulty <= x:
            count += sum(types_dict.values()) - types_dict.get(y, 0)
    
    print(count)
0