#include "doll.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
void create_circuit(int m, vector<int> A){
int n = A.size();
A.pb(0);
vector<vector<int>> pos(m);
for(int i = 0; i < n; i++) pos[A[i]-1].pb(i);
vector<int> C(m+1, 0), X, Y;
C[0] = A[0];
for(int i = 0; i < m; i++) if(!pos[i].empty()){
if(pos[i].size() == 1){
C[i+1] = A[pos[i][0]+1];
}
else{
X.pb(A[pos[i][0]+1]), Y.pb(A[pos[i][1]+1]);
C[i+1] = -int(X.size());
}
}
answer(C, X, Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
20 ms |
6560 KB |
Output is correct |
3 |
Correct |
17 ms |
5424 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
5 |
Correct |
8 ms |
3756 KB |
Output is correct |
6 |
Correct |
25 ms |
7856 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
20 ms |
6560 KB |
Output is correct |
3 |
Correct |
17 ms |
5424 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
5 |
Correct |
8 ms |
3756 KB |
Output is correct |
6 |
Correct |
25 ms |
7856 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
34 ms |
7536 KB |
Output is correct |
9 |
Correct |
34 ms |
8868 KB |
Output is correct |
10 |
Correct |
50 ms |
11460 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
20 ms |
6560 KB |
Output is correct |
3 |
Correct |
17 ms |
5424 KB |
Output is correct |
4 |
Correct |
1 ms |
300 KB |
Output is correct |
5 |
Correct |
8 ms |
3756 KB |
Output is correct |
6 |
Correct |
25 ms |
7856 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
34 ms |
7536 KB |
Output is correct |
9 |
Correct |
34 ms |
8868 KB |
Output is correct |
10 |
Correct |
50 ms |
11460 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Incorrect |
43 ms |
8432 KB |
wrong motion |
15 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |