結果
| 問題 | No.3085 Easy Problems |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-05 23:20:19 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,065 bytes |
| 記録 | |
| コンパイル時間 | 6,698 ms |
| コンパイル使用メモリ | 227,648 KB |
| 実行使用メモリ | 812,208 KB |
| 最終ジャッジ日時 | 2026-02-05 23:20:48 |
| 合計ジャッジ時間 | 11,328 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | MLE * 1 -- * 30 |
ソースコード
// BISMILLAH
// AUTHOR: KAMRAN
// Date: 2026-02-05 18:55
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define nl endl
void solve(){
int n;
cin>>n;
vector<pair<int,int>>x(n);
for(int i=0;i<n;i++){
cin>>x[i].first>>x[i].second;
}
sort(x.begin(),x.end());
map<int,vector<int>>freq;
vector<int>temp(10e5);
for(int i=0;i<n;i++){
temp[x[i].second]++;
freq[i]=temp;
}
int m;
cin>>m;
while(m--){
pair<int,int>y;
cin>>y.first>>y.second;
int low=0;
int high=n-1;
while(low<=high){
int mid=(low+high)/2;
if(x[mid].first>y.first)high=mid-1;
else low=mid+1;
}
// cout<<low<<nl;
if(low==0){
cout<<0<<nl;
continue;
}else{
low-=(freq[low-1][y.second]);
}
cout<<low<<nl;
}
};
signed main() {
fast;
// int t;
// cin>>t;
// while(t--)
solve();
return 0;
}
/*
2 2 3 5 10
5 50 500
*/