이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |