#include "doll.h"
#include <vector>
#include <stdio.h>
using namespace std;
int con[1000005]={0};
int This[1000005]={0};
vector < int > C,X,Y;
void create_circuit(int M, vector < int > A)
{
X.push_back(0);
Y.push_back(0);
int N=A.size(),now=1,i;
C.push_back(A[0]);
for(i=1;i<=M;i++) C.push_back(i);
for(i=0;i<N;i++) con[A[i]]++;
A.push_back(0);
for(i=0;i<M;i++)
{
if(con[A[i]]==1) C[A[i]]=A[i+1];
else
{
if(This[A[i]]==0)
{
C[A[i]]=-(now+1);
now++;
X.push_back(A[i+1]);
Y.push_back(A[i+1]);
}
else
{
Y[-C[A[i]]-1]=A[i+1];
//printf("%d %d %d %d\n",i,A[i+1],);
}
This[A[i]]++;
}
}
/*for(auto i:C) printf("%d ",i);
printf("\n");
for(i=1;i<now;i++) printf("%d %d\n",X[i],Y[i]);*/
//printf("\n");
answer(C,X,Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
38 ms |
2496 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
38 ms |
2496 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
38 ms |
2496 KB |
wrong motion |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |