# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
298036 | miss_robot | Ball Machine (BOI13_ballmachine) | C++14 | 370 ms | 26344 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>
#pragma GCC optimize("O3")
using namespace std;
const int N = 100000, L = 17;
int n, q, k, root, temp, c;
int p[L][N], mi[N], ball[N], lv[N], num[N];
vector<int> g[N];
bool comp(const int &a, const int &b){
return mi[a] < mi[b];
}
void dfs(int u, int h){
mi[u] = u;
lv[u] = h++;
for(int v : g[u]) dfs(v, h), mi[u] = min(mi[u], mi[v]);
sort(g[u].begin(), g[u].end(), comp);
}
void traverse(int u){
for(int v : g[u]) traverse(v);
num[u] = c++;
}
int main(){
# | 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... |