# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75298 | KieranHorgan | Mechanical Doll (IOI18_doll) | C++17 | 66 ms | 10436 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 "doll.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> A, X, Y, C;
int dep[200];
int nextSwitch = -1;
vector<int> AdjList[200005];
void buildTree(int curSwitch, int curTrigger) {
}
void create_circuit(int M, vector<int> A_) {
A = A_;
AdjList[0].push_back(A[0]);
for(int i = 0; i+1 < A.size(); i++) {
AdjList[A[i]].push_back(A[i+1]);
}
AdjList[A.back()].push_back(0);
C.assign(M+1, 0);
for(int i = 0; i <= M; i++) {
if(AdjList[i].size() == 0) {
} else if(AdjList[i].size() == 1) {
C[i] = AdjList[i][0];
} else {
C[i] = nextSwitch--;
buildTree(C[i], i);
}
}
// cerr << nextSwitch << endl;
// for(int i = 1; dep[i]; i++)
// cerr << i << ": " << dep[i] << endl;
//
// cerr << N << " " << X.size() << endl;
answer(C, X, Y);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |