#include "railroad.h"
#include <bits/stdc++.h>
using namespace std;
long long plan_roller_coaster(std::vector<int> s, std::vector<int> t)
{
#define int long long
int n = (int)s.size();
vector<pair<int, int>> ss, tt;
for(int i=0;i<n;i++)
{
tt.push_back({t[i], i});
ss.push_back({s[i], i});
}
sort(ss.rbegin(), ss.rend());
sort(tt.rbegin(), tt.rend());
int i = 0, j = 0;
while(i < n)
{
if(ss[i].second != tt[j].second)
{
if(tt[j].first > ss[i].first)
return 999;
}
else
{
if(tt[j].first > ss[i - 1].first)
return 999;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
answer is not correct: 999 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
answer is not correct: 999 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
68 ms |
13748 KB |
answer is not correct: 1 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
answer is not correct: 999 instead of 0 |
2 |
Halted |
0 ms |
0 KB |
- |