# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140423 | arthurconmy | Mechanical Doll (IOI18_doll) | C++14 | 50 ms | 7856 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>
#ifndef ARTHUR_LOCAL
#include "doll.h"
#endif
using namespace std;
const int MAXN=100000;
int apps[MAXN];
vector<int> go_to[MAXN];
#ifdef ARTHUR_LOCAL
void answer(vector<int> V, vector<int> X, vector<int> Y)
{
for(auto v:V) cout << v << " ";
cout << endl;
}
#endif
void create_circuit(int m, vector<int> A)
{
int n = A.size();
for(int i=0; i<n-1; i++)
{
go_to[A[i]].push_back(A[i+1]);
}
vector<int> C={A[0]};
int switch_no=0;
vector<int> X;
vector<int> Y;
for(int i=1; i<=m; i++)
{
if(go_to[i].empty())
{
C.push_back(0);
continue;
}
if(go_to[i].size() == 1)
{
C.push_back(go_to[i][0]);
continue;
}
// if(go_to[i].size() == 2)
// {
// switch_no++;
// C.push_back(-switch_no);
// X.push_back()
// }
}
answer(C,X,Y);
}
#ifdef ARTHUR_LOCAL
int main()
{
create_circuit(3,{1,2,3});
}
#endif
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... |