# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
871413 | Onur_Ilgaz | Papričice (COCI20_papricice) | C++17 | 113 ms | 25424 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>
#define fast cin.tie(0)->sync_with_stdio(0);
#define int long long
#define inf ((int)1e18)
#define N 200005
using namespace std;
vector <vector <int> > adj(N);
set <int> subt;
deque <int> dq;
int under[N];
int n, ans = inf;
void dfs0(int node, int ata) {
under[node] = 1;
for(auto it:adj[node]) {
if(it == ata) continue;
dfs0(it, node);
under[node] += under[it];
}
}
void dfs(int node, int ata) {
int a = under[node];
dq.push_front(a);
// ----------------------------------------
auto index = subt.lower_bound((n - a) / 2); // >= ilk eleman
if(index == subt.end() and subt.size()) index--;
// cout << node << ":\n";
// for(auto it:dq) {
// cout << it << " ";
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |