#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),ra.end()
#define sz(a) a.size()
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> C(M + 1,0);
vector<int> adj[M+1];
for(int i=1;i<N;i++){
adj[A[i-1]].pb(A[i]);
}
adj[A[N-1]].pb(0);
C[0]=A[0];
int k=-1;
vector<int> X, Y;
for (int i = 1; i <= M; i++) {
if(sz(adj[i])==2){
C[i]=k;
k--;
X.pb(adj[i][0]);
Y.pb(adj[i][1]);
}else C[i]=adj[i][0];
}
// for(int i=0;i<=M;i++){
// for(int j=0;j<sz(adj[i]);j++){
// cout<<adj[i][j]<<" ";
// }
// cout<<endl;
// }
// for (int k = 0; k < N; ++k) {
// X[k] = Y[k] = A[k];
// }
answer(C, X, Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
17 ms |
11604 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
17 ms |
11604 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
17 ms |
11604 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |