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) {
vector<pair<pair<int,int>, int>> p;
int n = x.size();
for(int i = 0;i<n;i++) {
p.push_back({{y[i], x[i]}, i});
}
sort(p.begin(), p.end());
vector<int> u, v, a, b;
for(int i = 1;i<n;i++) {
if(p[i].first.first == p[i-1].first.first+2) {
u.push_back(p[i-1].second);
v.push_back(p[i].second);
a.push_back(p[i].first.second+1);
b.push_back(p[i].first.first-1);
}
else {
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... |