# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
799638 | Khizri | Roller Coaster Railroad (IOI16_railroad) | C++17 | 108 ms | 14364 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 "railroad.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define INF 1e18
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define OK cout<<"Ok"<<endl;
#define MOD (ll)(1e9+7)
bool cmp(pii a,pii b){
if(a.S==b.S) return a.F<b.F;
return a.S<b.S;
}
long long plan_roller_coaster(vector<int> s, vector<int> t) {
int n = (int) s.size();
vector<pii>vt;
multiset<int>st;
for(int i=0;i<n;i++){
vt.pb({s[i],t[i]});
st.insert(s[i]);
}
sort(all(vt),cmp);
for(int i=0;i<vt.size()-1;i++){
st.erase(st.find(s[i]));
if(*st.begin()<t[i]&&vt[i+1].S>t[i]){
return 1;
}
}
return 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... |