Submission #786944

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7869442023-07-18 15:21:23n1427Ball Machine (BOI13_ballmachine)C++17
100 / 100
189 ms27932 KiB
#include <bits/stdc++.h>
using namespace std;
int n, q, root, timer = 0;
vector<int> parent, depth, subtreeMin, subtreeSize, timeIn;
vector<vector<int>> ancestor;
vector<vector<int>> adjList;
vector<pair<int, int>> queries;
vector<bool> colour;
priority_queue<pair<int, int>> whiteNodes;
void depthFirstSearchA(const int& u)
{
subtreeMin[u] = u;
subtreeSize[u] = 1;
for (auto &v : adjList[u])
{
depth[v] = depth[u] + 1;
ancestor[v][0] = u;
for (int b = 1; ancestor[v][b - 1] != -1; b++)
ancestor[v][b] = ancestor[ancestor[v][b - 1]][b - 1];
depthFirstSearchA(v);
subtreeMin[u] = min(subtreeMin[v], subtreeMin[u]);
subtreeSize[u] += subtreeSize[v];
}
sort(adjList[u].begin(), adjList[u].end(), [&](const int& v1, const int& v2) -> bool
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...