#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> X, Y, C;
int ms(int a, int b) {
X.push_back(a);
Y.push_back(b);
return -Y.size();
}
vector<int> adj[500100];
void create_circuit(int M, std::vector<int> A) {
C.resize(M+1);
int n = A.size();
adj[0].push_back(A[0]);
A.push_back(0);
for(int i = 0; i < n; i++)
adj[A[i]].push_back(A[i+1]);
for(int i = 0; i <= M; i++) {
switch(adj[i].size()) {
case 1:C[i] = adj[i][0];break;
case 2:C[i] = ms(adj[i][0], adj[i][1]);break;
case 3:C[i] = ms(ms(adj[i][0], adj[i][2]), adj[i][1]);break;
case 4:C[i] = ms(ms(adj[i][0], adj[i][2]), ms(adj[i][1], adj[i][3]));break;
}
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11988 KB |
Output is correct |
2 |
Correct |
24 ms |
16244 KB |
Output is correct |
3 |
Correct |
20 ms |
15876 KB |
Output is correct |
4 |
Correct |
7 ms |
11988 KB |
Output is correct |
5 |
Correct |
15 ms |
13160 KB |
Output is correct |
6 |
Correct |
30 ms |
17920 KB |
Output is correct |
7 |
Correct |
6 ms |
12044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11988 KB |
Output is correct |
2 |
Correct |
24 ms |
16244 KB |
Output is correct |
3 |
Correct |
20 ms |
15876 KB |
Output is correct |
4 |
Correct |
7 ms |
11988 KB |
Output is correct |
5 |
Correct |
15 ms |
13160 KB |
Output is correct |
6 |
Correct |
30 ms |
17920 KB |
Output is correct |
7 |
Correct |
6 ms |
12044 KB |
Output is correct |
8 |
Correct |
39 ms |
19072 KB |
Output is correct |
9 |
Correct |
43 ms |
19440 KB |
Output is correct |
10 |
Correct |
58 ms |
23252 KB |
Output is correct |
11 |
Correct |
6 ms |
12044 KB |
Output is correct |
12 |
Correct |
6 ms |
12044 KB |
Output is correct |
13 |
Correct |
6 ms |
12048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11988 KB |
Output is correct |
2 |
Correct |
24 ms |
16244 KB |
Output is correct |
3 |
Correct |
20 ms |
15876 KB |
Output is correct |
4 |
Correct |
7 ms |
11988 KB |
Output is correct |
5 |
Correct |
15 ms |
13160 KB |
Output is correct |
6 |
Correct |
30 ms |
17920 KB |
Output is correct |
7 |
Correct |
6 ms |
12044 KB |
Output is correct |
8 |
Correct |
39 ms |
19072 KB |
Output is correct |
9 |
Correct |
43 ms |
19440 KB |
Output is correct |
10 |
Correct |
58 ms |
23252 KB |
Output is correct |
11 |
Correct |
6 ms |
12044 KB |
Output is correct |
12 |
Correct |
6 ms |
12044 KB |
Output is correct |
13 |
Correct |
6 ms |
12048 KB |
Output is correct |
14 |
Incorrect |
60 ms |
22356 KB |
state 'Y' |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
11988 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
11988 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
11988 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |