# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120912 | KieranHorgan | Jousting tournament (IOI12_tournament) | C++17 | 83 ms | 19908 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;
vector<int> AdjList[400005];
int sz[400005];
int curNode = 1;
int N, C, R, *K, *S, *E;
int actualIdxToNode[100005];
int nodeToActualIdx[100005];
void addNode(int id, int curIdx, int idxToAdd, int sizeToAdd) {
if(AdjList[id].empty()) {
for(int i = 0; i < sizeToAdd; i++) {
AdjList[id].push_back(++curNode);
sz[curNode] = 1;
}
} else {
for(auto v: AdjList[id]) {
if(curIdx + sz[v] <= idxToAdd) {
curIdx += sz[v];
} else {
addNode(v, curIdx, idxToAdd, sizeToAdd);
break;
}
}
}
sz[id] = 0;
for(auto v: AdjList[id])
sz[id] += sz[v];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |