#include "doll.h"
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> C(M+1,0);
vector<int> X(M+1,0),Y(M+1,0);
int a[M+1]{0};
C[0]=A[0];
for(int i=0;i<N;i++)a[A[i]]++;
for (int i = 1; i < N; ++i) {
if(a[A[i-1]]>1){
if(X[A[i-1]]==0)X[A[i-1]]=A[i];
else Y[A[i-1]]=A[i];
}
C[A[i-1]]=A[i];
}
vector<int> x,y;
for(int i=1;i<=M;i++){
if(X[i]==0)continue;
C[i]=-1 * (x.size()+1);
x.pb(X[i]);
y.pb(Y[i]);
}
answer(C, x, y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
17 ms |
3264 KB |
Output is correct |
3 |
Correct |
13 ms |
2528 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
8 ms |
2600 KB |
Output is correct |
6 |
Correct |
20 ms |
3676 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
17 ms |
3264 KB |
Output is correct |
3 |
Correct |
13 ms |
2528 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
8 ms |
2600 KB |
Output is correct |
6 |
Correct |
20 ms |
3676 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
35 ms |
4868 KB |
Output is correct |
9 |
Correct |
36 ms |
5364 KB |
Output is correct |
10 |
Correct |
50 ms |
7360 KB |
Output is correct |
11 |
Correct |
1 ms |
256 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
17 ms |
3264 KB |
Output is correct |
3 |
Correct |
13 ms |
2528 KB |
Output is correct |
4 |
Correct |
1 ms |
296 KB |
Output is correct |
5 |
Correct |
8 ms |
2600 KB |
Output is correct |
6 |
Correct |
20 ms |
3676 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
35 ms |
4868 KB |
Output is correct |
9 |
Correct |
36 ms |
5364 KB |
Output is correct |
10 |
Correct |
50 ms |
7360 KB |
Output is correct |
11 |
Correct |
1 ms |
256 KB |
Output is correct |
12 |
Correct |
0 ms |
340 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Incorrect |
42 ms |
5772 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |