Submission #742863

#TimeUsernameProblemLanguageResultExecution timeMemory
742863t6twotwoFountain Parks (IOI21_parks)C++17
5 / 100
54 ms9000 KiB
#include "parks.h" #include <bits/stdc++.h> using namespace std; int construct_roads(std::vector<int> x, std::vector<int> y) { int n = x.size(); if (x == vector<int>(n, 2)) { int mn = *min_element(y.begin(), y.end()); int mx = *max_element(y.begin(), y.end()); if (mx - mn != (n - 1) * 2) { return 0; } vector<int> p(n); iota(p.begin(), p.end(), 0); sort(p.begin(), p.end(), [&](int i, int j) { return y[i] < y[j]; }); vector<int> u(n - 1), v(n - 1), a(n - 1), b(n - 1); for (int i = 0; i < n - 1; i++) { u[i] = p[i]; v[i] = p[i + 1]; a[i] = 3; b[i] = y[p[i]] + 1; } build(u, v, a, b); return 1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...