結果

問題 No.3085 Easy Problems
コンテスト
ユーザー 👑 amentorimaru
提出日時 2025-04-04 20:46:41
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 492 ms / 2,000 ms
コード長 506 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 252 ms
コンパイル使用メモリ 95,980 KB
実行使用メモリ 102,960 KB
最終ジャッジ日時 2026-07-08 08:18:20
合計ジャッジ時間 16,443 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import bisect
input = sys.stdin.readline
def read_values(): return map(int, input().split())



def main():
  n = int(input())
  c0 = list()
  c = [list() for _ in range(100000)]
  for _ in range(n):
     a,b=read_values()
     c0.append(a)
     c[b-1].append(a)
  c0.sort()
  for i in range(100000):
     c[i].sort()
  q=int(input())
  for _ in range(q):
     x,y=read_values()
     print(bisect.bisect_left(c0,x+1)-bisect.bisect_left(c[y-1],x+1))
        
if __name__ == "__main__":
    main()
0