# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
402579 | faresbasbs | Fun Tour (APIO20_fun) | C++14 | 6 ms | 6348 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>
#include "fun.h"
using namespace std;
int n,bad[300001],h[100001];
multiset<int> ms[100001];
void dfs(int curr , int hi){
h[curr] = hi;
ms[curr].insert(hi);
for(int i = 2*curr+1 ; i <= 2*curr+2 ; i += 1){
if(i >= n){
continue;
}
dfs(i,hi+1);
for(auto j : ms[i]){
ms[curr].insert(j);
}
}
}
int solve(int curr){
bad[curr] = 1;
int from = -1 , root = curr;
while(curr && !bad[(curr-1)/2]){
from = curr;
ms[curr].erase(ms[curr].find(h[root]));
curr = (curr-1)/2;
}
ms[curr].erase(ms[curr].find(h[root]));
// cout << curr << endl;
# | 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... |