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(std::vector<int> x, std::vector<int> y) {
if (x.size() == 1) {
build({}, {}, {}, {});
return 1;
}
int n = x.size();
std::vector<int> u, v, a, b;
vector<int> ix(n);
iota(ix.begin(), ix.end(), 0);
sort(ix.begin(), ix.end(), [&](int a, int b) {
return y[a] < y[b];
});
for (int i = 1; i <n; i++) {
u.push_back(ix[i-1]);
v.push_back(ix[i]);
a.push_back(1);
b.push_back(y[ix[i]]-1);
if (i && y[ix[i]] != y[ix[i-1]]+2)
return 0;
}
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... |