# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
601609 | enerelt14 | Mechanical Doll (IOI18_doll) | C++14 | 63 ms | 12828 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>
#define pb push_back
using namespace std;
void create_circuit(int M, vector<int>A){
vector<int>adj[M+1], c(M+1), x, y;
c[0]=A[0];
A.pb(0);
for (int i=0;i<A.size()-1;i++){
adj[A[i]].pb(A[i+1]);
}
int num=0;
for (int i=1;i<=M;i++){
if (adj[i].size()==0)c[i]=0;
else if(adj[i].size()==1)c[i]=adj[i][0];
else{
num++;
c[i]=-num;
x.pb(adj[i][0]);
y.pb(adj[i][1]);
}
}
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... |