#include "doll.h"
#include <vector>
#include <cstring>
using namespace std;
void create_circuit(int M, std::vector<int> A) {
int k=-1;
int n = A.size();
bool visit[M];
memset(visit,false,sizeof(visit));
vector<int> c,X,Y;
for (int x=0;x<=M;x++){
c.push_back(0);
}
int curr=0;
for (int x=0;x<n;x++){
if (!visit[curr]){
c[curr]=k;
visit[curr]=true;
Y.push_back(A[x]);
X.push_back(k--);
}
else{
X[(-c[curr])-1]=Y[(-c[curr])-1];
Y[(-c[curr])-1]=A[x];
}
curr=A[x];
}
if (!visit[curr]){
c[curr]=0;
}
else{
X[(-c[curr])-1]=Y[(-c[curr])-1];
Y[(-c[curr])-1]=0;
}
answer(c,X,Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Runtime error |
18 ms |
3100 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Runtime error |
18 ms |
3100 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Runtime error |
18 ms |
3100 KB |
Execution killed with signal 6 |
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 |
- |