# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
735587 | Koful123 | Papričice (COCI20_papricice) | C++17 | 428 ms | 29152 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 endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int N = 2e5 + 5;
int ans = 1e18,n;
vector<int> adj[N],sz(N);
multiset<int> other,anc;
void calc(int node,int p){
sz[node] = 1;
for(int go : adj[node]){
if(go == p) continue;
calc(go,node);
sz[node] = sz[go] + sz[node];
}
}
int search(multiset<int> &s,int x,int ty){
int res = 1e18,cur = x;
if(!ty) cur = (n - x) / 2 + x;
else cur = (n - x) / 2;
auto it = s.upper_bound(cur);
if(ty){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |