#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
void create_circuit(int M, vector<int> A) {
int N = A.size();
vector<int> C(M + 1), X, Y;
vector<vector<int>> next(M + 1);
C[0] = A[0];
A.push_back(0);
for (int i = 0; i < N; ++i) {
next[A[i]].push_back(A[i + 1]);
}
for (int i = 1; i <= M; ++i) {
if (next[i].empty()) {
continue;
}
if (next[i].size() == 1) {
C[i] = next[i][0];
}
else {
C[i] = -(int)X.size() - 1;
X.push_back(next[i][0]);
Y.push_back(next[i][1]);
}
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
30 ms |
6344 KB |
Output is correct |
3 |
Correct |
24 ms |
5064 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
12 ms |
3788 KB |
Output is correct |
6 |
Correct |
45 ms |
7724 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
30 ms |
6344 KB |
Output is correct |
3 |
Correct |
24 ms |
5064 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
12 ms |
3788 KB |
Output is correct |
6 |
Correct |
45 ms |
7724 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
64 ms |
7200 KB |
Output is correct |
9 |
Correct |
55 ms |
8512 KB |
Output is correct |
10 |
Correct |
85 ms |
11280 KB |
Output is correct |
11 |
Correct |
0 ms |
204 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
30 ms |
6344 KB |
Output is correct |
3 |
Correct |
24 ms |
5064 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
12 ms |
3788 KB |
Output is correct |
6 |
Correct |
45 ms |
7724 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
64 ms |
7200 KB |
Output is correct |
9 |
Correct |
55 ms |
8512 KB |
Output is correct |
10 |
Correct |
85 ms |
11280 KB |
Output is correct |
11 |
Correct |
0 ms |
204 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
0 ms |
204 KB |
Output is correct |
14 |
Incorrect |
86 ms |
8104 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |