#include <bits/stdc++.h>
#ifndef ARTHUR_LOCAL
#include "railroad.h"
#endif
using namespace std;
using ll=long long;
const int MAXN = 200000;
ll plan_roller_coaster(vector<int> s, vector<int> t)
{
int n = s.size();
vector<pair<int,int>> TS;
for(int i=0; i<n; i++)
{
TS.push_back({t[i],s[i]});
}
sort(TS.begin(),TS.end());
vector<int> vals;
for(int i=0; i<n; i++)
{
int k = lower_bound(TS.begin(),TS.end(),make_pair(TS[i].second,0)) - TS.begin();
// if(TS[0].first > TS[i].second) vals.push_back(-1);
vals.push_back(k);
}
sort(vals.begin(),vals.end());
int offences=0;
for(int i=0; i<n; i++)
{
if(vals[i] > i) offences++;
}
if(offences>1) return 1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
142 ms |
6888 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |