結果
| 問題 | 
                            No.3085 Easy  Problems
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-04-05 19:16:13 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 557 bytes | 
| コンパイル時間 | 1,594 ms | 
| コンパイル使用メモリ | 170,180 KB | 
| 実行使用メモリ | 32,800 KB | 
| 最終ジャッジ日時 | 2025-04-05 19:16:21 | 
| 合計ジャッジ時間 | 7,099 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | TLE * 1 -- * 30 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
int main() {
  int n;
  cin >> n;
  map<int, vector<int>> problem;
  rep(i, n) {
    int a, b;
    cin >> a >> b;
    problem[a].push_back(b);
  }
  int q;
  cin >> q;
  rep(i, q) {
    int x, y;
    cin >> x >> y;
    int ans = 0;
    for (auto it = problem.begin(); it != problem.end(); it++) {
      if (it->first > x) break;
      ans += it->second.size() - count(it->second.begin(), it->second.end(), y);
    }
    cout << ans << endl;
  }
  return 0;
}