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;
#define fore(i , n) for(int i = 0 ; i<n;i++)
#define forr(i , x , y) for(int i = x; i<=y;i++)
#define forn(i , x , y) for(int i = x ; i>=y;i--)
#define vi vector<int>
#define vii vector<pair<int ,int>>
#define pb push_back
#define lint long long
#define sz(s) (int)s.size()
#define all(v) v.begin() , v.end()
#define nl '\n'
lint plan_roller_coaster(vi s , vi t)
{
int n = sz(s);
vii v(n);
fore(i , n)
{
v[i] = {s[i] , t[i]};
}
sort(all(v));
fore(i , n)
{
s[i] = v[i].first ;
t[i] = v[i].second;
}
int acc = 1;
fore(i , n - 1)
{
if(!(s[i] <= t[i] && t[i] <= s[i + 1]))
{
acc = 0;
break;
}
}
if((s[n - 1] > t[n - 1]))
acc = 0;
return 1 - acc;
}
# | 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... |