# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
538164 | huangqr | Event Hopping 2 (JOI21_event2) | C++14 | 3043 ms | 6156 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;
typedef long long ll;
typedef pair<ll,ll>pl;
set<pl>taken;
ll chk(deque<pl>d){
sort(d.begin(),d.end(),[](pl a,pl b){
return a.second<b.second;
});
ll cur=-1,ans=0;
for(auto x:d){
auto it=taken.lower_bound(make_pair(x.first,-1));
if(it!=taken.end()){
if(it->first<x.second)continue;
}
if(it!=taken.begin()){
it--;
if(it->second>x.first)continue;
}
if(x.first>=cur){
ans++;
cur=x.second;
}
}
return ans;
}
int main(){
ios_base::sync_with_stdio(0),cin.tie(0);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |