# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1039922 | yanb | Fountain Parks (IOI21_parks) | C++17 | 977 ms | 112104 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 <bits/stdc++.h>
using namespace std;
//#define int long long
//#define pii pair<long long, long long>
#define pii pair<int, int>
#define pib pair<int, bool>
#define fi first
#define se second
void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b);
void dfs(int v, vector<vector<int>> &g, vector<bool> &uu) {
if (uu[v]) return;
uu[v] = 1;
for (int u : g[v]) dfs(u, g, uu);
}
void follow(int v, vector<vector<int>> &h, vector<int> &a, vector<int> &b, map<pii, int> &mid,
vector<pii> &pm, vector<int> &x, vector<int> &y) {
if (h[v].empty()) return;
while (h[v].size()){
int u = h[v].back();
//cout << "Erasing " << pm[v].fi << "," << pm[v].se << " ~ " << pm[u].fi << "," << pm[u].se << "\n";
h[v].erase(remove(h[v].begin(), h[v].end(), u), h[v].end());
h[u].erase(remove(h[u].begin(), h[u].end(), v), h[u].end());
int pd = mid[{(pm[v].fi + pm[u].fi) / 2, (pm[v].se + pm[u].se) / 2}];
a[pd] = pm[u].fi;
b[pd] = pm[u].se;
# | 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... |