#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
int plan_roller_coaster(std::vector<int32_t> s, std::vector<int32_t> t) {
int n = (int) s.size();
vector<int> S1;
vector<int> S2 = {1};
for (int i=0; i<n; i++) {
S1.push_back(s[i]);
S2.push_back(t[i]);
}
sort(S1.begin(), S1.end());
sort(S2.begin(), S2.end());
S2.pop_back();
int fail=0;
for (int i=0; i<n; i++) {
int ind=(upper_bound(S2.begin(), S2.end(),(S1[i]))-S2.begin());
int i1=(upper_bound(S1.begin(), S1.end(), (S1[i]))-S1.begin());
if (n-ind > i1) {
fail=1;
}
}
return fail;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
n = 2 |
2 |
Correct |
0 ms |
348 KB |
n = 2 |
3 |
Correct |
0 ms |
348 KB |
n = 2 |
4 |
Correct |
0 ms |
600 KB |
n = 2 |
5 |
Correct |
0 ms |
344 KB |
n = 2 |
6 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 0 instead of 523688153 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
n = 2 |
2 |
Correct |
0 ms |
348 KB |
n = 2 |
3 |
Correct |
0 ms |
348 KB |
n = 2 |
4 |
Correct |
0 ms |
600 KB |
n = 2 |
5 |
Correct |
0 ms |
344 KB |
n = 2 |
6 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 0 instead of 523688153 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
79 ms |
11044 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
n = 2 |
2 |
Correct |
0 ms |
348 KB |
n = 2 |
3 |
Correct |
0 ms |
348 KB |
n = 2 |
4 |
Correct |
0 ms |
600 KB |
n = 2 |
5 |
Correct |
0 ms |
344 KB |
n = 2 |
6 |
Incorrect |
0 ms |
348 KB |
answer is not correct: 0 instead of 523688153 |
7 |
Halted |
0 ms |
0 KB |
- |