#include"bits/stdc++.h"
// #include"grader.cpp"
// #define int long long
#include"parks.h"
#define endl '\n'
using namespace std;
// void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b);
int construct_roads(std::vector<int> x, std::vector<int> y) {
int n = x.size();
vector<pair<int,int>> v;
for (int i = 0 ; i < n ; i++) v.emplace_back(y[i], i);
sort(v.begin(), v.end());
for (int i = 1 ; i < n ; i++) {
if (v[i].first != v[i-1].first + 2) return 0;
}
vector<int> u, vv, a, b;
for (int i = 1 ; i < n ; i++) {
u.push_back(v[i-1].second);
vv.push_back(v[i].second);
a.push_back(x[0] + 1);
b.push_back(v[i-1].first + 1);
}
build(u, vv, a, b);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
17 |
Incorrect |
1 ms |
204 KB |
Solution announced impossible, but it is possible. |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
17 |
Incorrect |
1 ms |
204 KB |
Solution announced impossible, but it is possible. |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
17 |
Incorrect |
1 ms |
204 KB |
Solution announced impossible, but it is possible. |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
17 |
Incorrect |
69 ms |
5556 KB |
Solution announced impossible, but it is possible. |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
70 ms |
8092 KB |
Output is correct |
10 |
Correct |
7 ms |
1148 KB |
Output is correct |
11 |
Correct |
32 ms |
4396 KB |
Output is correct |
12 |
Correct |
9 ms |
1468 KB |
Output is correct |
13 |
Correct |
10 ms |
1608 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
332 KB |
Output is correct |
16 |
Correct |
69 ms |
8132 KB |
Output is correct |
17 |
Incorrect |
1 ms |
204 KB |
Solution announced impossible, but it is possible. |
18 |
Halted |
0 ms |
0 KB |
- |