This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;
int construct_roads(vector<int> x, vector<int> y) {
int n = (int) x.size();
vector<pair<int, int>> ys;
for (int i = 0; i < n; ++i) {
ys.emplace_back(y[i], i);
}
sort(ys.begin(), ys.end());
vector<int> u(n - 1), v(n - 1), a(n - 1), b(n - 1);
for (int i = 0; i < n - 1; ++i) {
if (ys[i + 1].first - ys[i].first != 2) {
return 0;
}
u[i] = ys[i].second;
v[i] = ys[i + 1].second;
a[i] = 1;
b[i] = ys[i].first + 1;
}
build(u, v, a, b);
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |