結果
問題 |
No.3085 Easy Problems
|
ユーザー |
|
提出日時 | 2025-04-04 22:14:01 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 692 bytes |
コンパイル時間 | 2,124 ms |
コンパイル使用メモリ | 205,616 KB |
実行使用メモリ | 9,948 KB |
最終ジャッジ日時 | 2025-04-04 22:14:14 |
合計ジャッジ時間 | 9,124 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<tuple<int,int,int>> a(n); for(auto &&[x, y, z] : a){ cin >> x >> y; z = -1; } int Q; cin >> Q; a.reserve(n + Q); for(int i = 0; i < Q; i++){ int x, y; cin >> x >> y; a.emplace_back(x, y, i); } sort(a.begin(), a.end()); int tot = 0; vector<int> ans(Q), cnt(100001); for(auto &&[x, y, z] : a){ if(z == -1){ cnt[y]++; tot++; }else{ ans[z] = tot - cnt[y]; } } for(auto &&v : ans) cout << v << '\n'; }