# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83237 | teomrn | Ball Machine (BOI13_ballmachine) | C++14 | 1089 ms | 37536 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;
const int NMAX = 100010;
const int LGMAX = 18;
vector <int> adia[NMAX + 10];
int nr_fii_activi[NMAX + 10];
bool taken[NMAX + 10];
int tata[NMAX + 10];
namespace RMQ {
int h[NMAX + 10];
int stramos[LGMAX + 1][NMAX + 10];
int vmin[NMAX + 10];
void dfs(int nod, int tata) {
h[nod] = 1 + h[tata];
vmin[nod] = nod;
stramos[0][nod] = tata;
for (int i = 1; i <= LGMAX; i++)
stramos[i][nod] = stramos[i - 1][stramos[i - 1][nod]];
for (auto i : adia[nod]) {
dfs(i, nod);
vmin[nod] = min(vmin[nod], vmin[i]);
}
}
bool mai_mic(int a, int b) {
if (h[a] < h[b])
Compilation message (stderr)
# | 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... |