# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1026926 | nisanduu | Mechanical Doll (IOI18_doll) | C++14 | 13 ms | 3164 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;
void create_circuit(int M, std::vector<int> A) {
int N = A.size();
std::vector<int> C(M + 1,-1);
vector<int> unused;
int sz = A.size();
C[0] = A[0];
for(int i=0;i<(A.size()-1);i++){
C[A[i]] = A[i+1];
}
C[A[sz-1]]=0;
for(int i=0;i<(M+1);i++){
if(C[i]==-1){
unused.push_back(i);
}
}
sz = unused.size();
for(int i=0;i<(sz-1);i++){
C[unused[i]] = unused[i+1];
}
vector<int> X,Y;
if(sz>0){
C[unused[sz-1]] = 0;
}
//std::vector<int> X(N), Y(N);
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... |