結果
問題 |
No.3085 Easy Problems
|
ユーザー |
![]() |
提出日時 | 2025-04-04 21:41:08 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 799 bytes |
コンパイル時間 | 3,666 ms |
コンパイル使用メモリ | 286,248 KB |
実行使用メモリ | 813,824 KB |
最終ジャッジ日時 | 2025-04-04 21:41:55 |
合計ジャッジ時間 | 9,167 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | RE * 3 MLE * 1 -- * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long #define mod 1000000007 int main(){ cin.tie(0)->sync_with_stdio(0); cout.tie(0); int N,Q; pair<ll,ll> AB[20009]; ll X[20009],Y[20009]; cin>>N; for(int i=1;i<=N;i++) cin>>AB[i].first>>AB[i].second; sort(AB+1,AB+N+1); cin>>Q; map<int,int>now; map<int,int>data[2009];//////////////////////// for(int i=1;i<=N;i++) now[AB[i].second]=0; for(int i=1;i<=N;i++){ now[AB[i].second]++; data[i]=now; } for(int i=1;i<=Q;i++){ cin>>X[i]>>Y[i]; auto iter=lower_bound(AB+1,AB+N+1,make_pair(X[i]+1,0LL)); int idx=distance(AB+1,iter); idx-=data[idx][Y[i]]; cout<<idx<<endl; } }