# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1049101 | nisanduu | Fountain Parks (IOI21_parks) | C++17 | 32 ms | 8340 KiB |
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;
typedef long long ll;
int construct_roads(std::vector<int> x, std::vector<int> y) {
ll n = x.size();
vector<pair<int,int>> arr(n);
for(int i=0;i<n;i++){
arr[i].first = y[i];
arr[i].second = i;
}
sort(arr.begin(),arr.end());
vector<int> u, v, a, b;
bool f=1;
for(ll i=0;i<n-1;i++){
if((arr[i+1].first - arr[i].first) != 2){
return 0;
}
u.push_back(arr[i+1].second);
v.push_back(arr[i].second);
a.push_back(1);
b.push_back((arr[i+1].first+arr[i].first)/2);
}
build(u, v, a, b);
return 1;
}
Compilation message (stderr)
# | 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... |