#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX = 100007;
vector<int> occur[MAX];
int cn[MAX];
void create_circuit(int M, vector<int> A) {
int N = A.size();
for (int i = 0; i < N; ++i) occur[A[i]].push_back(i);
A.push_back(0);
occur[0].push_back(0);
vector<int> C, X, Y;
C.resize(M + 1);
int pv = 0, sn = 0;
for (int i = 0; i < N; ++i) {
if (occur[pv].size() == 1) C[pv] = A[i];
else if (C[pv] >= 0) {
C[pv] = --sn;
X.push_back(A[occur[pv][cn[pv]++] + 1]);
Y.push_back(A[occur[pv][cn[pv]++] + 1]);
}
pv = A[i];
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2908 KB |
Output is correct |
2 |
Correct |
17 ms |
6556 KB |
Output is correct |
3 |
Correct |
16 ms |
6480 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
7 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8268 KB |
Output is correct |
7 |
Correct |
1 ms |
2908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2908 KB |
Output is correct |
2 |
Correct |
17 ms |
6556 KB |
Output is correct |
3 |
Correct |
16 ms |
6480 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
7 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8268 KB |
Output is correct |
7 |
Correct |
1 ms |
2908 KB |
Output is correct |
8 |
Correct |
31 ms |
9316 KB |
Output is correct |
9 |
Correct |
35 ms |
10572 KB |
Output is correct |
10 |
Correct |
49 ms |
14372 KB |
Output is correct |
11 |
Correct |
1 ms |
2908 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2908 KB |
Output is correct |
2 |
Correct |
17 ms |
6556 KB |
Output is correct |
3 |
Correct |
16 ms |
6480 KB |
Output is correct |
4 |
Correct |
1 ms |
2908 KB |
Output is correct |
5 |
Correct |
7 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8268 KB |
Output is correct |
7 |
Correct |
1 ms |
2908 KB |
Output is correct |
8 |
Correct |
31 ms |
9316 KB |
Output is correct |
9 |
Correct |
35 ms |
10572 KB |
Output is correct |
10 |
Correct |
49 ms |
14372 KB |
Output is correct |
11 |
Correct |
1 ms |
2908 KB |
Output is correct |
12 |
Correct |
1 ms |
2908 KB |
Output is correct |
13 |
Correct |
1 ms |
2908 KB |
Output is correct |
14 |
Incorrect |
43 ms |
11420 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2908 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2908 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2908 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |