# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714705 | dsyz | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 14 ms | 23768 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAXN (1000005)
int main() {
ios_base::sync_with_stdio(false);cin.tie(0);
ll N,K;
cin>>N>>K;
ll A[N], B[N], a[N], b[N];
vector<ll> d;
for(ll i = 0;i < N;i++){
cin>>A[i]>>B[i];
a[i] = A[i];
b[i] = B[i];
d.push_back(A[i]);
d.push_back(B[i]);
}
ll T[K];
for(ll i = 0;i < K;i++){
cin>>T[i];
d.push_back(T[i]);
}
sort(d.begin(),d.end());
d.resize(unique(d.begin(),d.end()) - d.begin());
for(ll i = 0;i < N;i++){
A[i] = lower_bound(d.begin(),d.end(),A[i]) - d.begin();
B[i] = lower_bound(d.begin(),d.end(),B[i]) - d.begin();
}
for(ll i = 0;i < K;i++){
T[i] = lower_bound(d.begin(),d.end(),T[i]) - d.begin();
}
vector<ll> v[MAXN]; //stores the i
for(ll i = 0;i < N;i++){
v[A[i]].push_back(i);
v[B[i]].push_back(i);
}
ll sum = 0;
cout<<sum<<'\n';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |