Submission #1020571

#TimeUsernameProblemLanguageResultExecution timeMemory
1020571NeroZeinFountain Parks (IOI21_parks)C++17
5 / 100
44 ms10176 KiB
#include "parks.h" #include <bits/stdc++.h> using namespace std; int construct_roads(vector<int> x, vector<int> y) { int n = (int) x.size(); vector<pair<int, int>> ys; for (int i = 0; i < n; ++i) { ys.emplace_back(y[i], i); } sort(ys.begin(), ys.end()); vector<int> u(n - 1), v(n - 1), a(n - 1), b(n - 1); for (int i = 0; i < n - 1; ++i) { if (ys[i + 1].first - ys[i].first != 2) { return 0; } u[i] = ys[i].second; v[i] = ys[i + 1].second; a[i] = 1; b[i] = ys[i].first + 1; } build(u, v, a, b); return 1; }
#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...