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;
using ll = long long;
int construct_roads(vector<int> X, vector<int> Y) {
int N = X.size();
vector<int> ord(N);
iota(ord.begin(), ord.end(), 0);
sort(ord.begin(), ord.end(), [&](int i, int j) {
return Y[i] < Y[j];
});
vector<int> u, v, a, b;
for (int i = 0; i < N - 1; i++) {
if (Y[ord[i]] + 2 != Y[ord[i + 1]]) {
return 0;
}
u.push_back(ord[i]);
v.push_back(ord[i + 1]);
a.push_back(1);
b.push_back(Y[ord[i]] + 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... |