#include "doll.h"
#include <stdio.h>
void create_circuit(int M, std::vector<int> A)
{
int N = A.size();
std::vector<int> C(M+ 1);
std::vector<int> check(M+1);
int mul=0;
for(int i=0; i<N; i++)
{
if(check[A[i]]!=0)
mul++;
check[A[i]]++;
}
std::vector<int> X(mul), Y(mul);
C[0] = A[0];
int sw=-1;
for (int i = 1; i < N; ++i)
{
if(check[A[i-1]]==1)
C[A[i-1]]=A[i];
else if(check[A[i-1]]==2)
{
C[A[i-1]]=sw;
sw--;
check[A[i-1]]=3;
X[(-1)*sw-2]=A[i];
}
else
{
Y[(-1)*C[A[i-1]]-1]=A[i];
}
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
22 ms |
2336 KB |
Output is correct |
3 |
Correct |
17 ms |
1828 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
17 ms |
1740 KB |
Output is correct |
6 |
Correct |
44 ms |
2596 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
22 ms |
2336 KB |
Output is correct |
3 |
Correct |
17 ms |
1828 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
17 ms |
1740 KB |
Output is correct |
6 |
Correct |
44 ms |
2596 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
42 ms |
3916 KB |
Output is correct |
9 |
Correct |
41 ms |
3876 KB |
Output is correct |
10 |
Correct |
64 ms |
5700 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
2 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
22 ms |
2336 KB |
Output is correct |
3 |
Correct |
17 ms |
1828 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
17 ms |
1740 KB |
Output is correct |
6 |
Correct |
44 ms |
2596 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
42 ms |
3916 KB |
Output is correct |
9 |
Correct |
41 ms |
3876 KB |
Output is correct |
10 |
Correct |
64 ms |
5700 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
2 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Incorrect |
92 ms |
6044 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |