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 "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
int construct_roads(vector<int> x, vector<int> y) {
int n = x.size();
int N = 2e5;
vector<map<int, int>> id(N + 1);
for (int i = 0; i < n; ++i) {
id[x[i]][y[i]] = i;
}
int cnt = 0;
vector<int> u, v, a, b;
for (int i = 0; i < n; ++i) {
if (id[x[i]].count(y[i] + 2)) {
u.push_back(i);
v.push_back(id[x[i]][y[i] + 2]);
a.push_back(x[i] + 1);
b.push_back(y[i] + 1);
++cnt;
}
}
if (cnt == n - 1) {
build(u, v, a, b);
return 1;
}
return 0;
}
# | 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... |