#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));
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 |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
48 ms |
8784 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |