#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++) {
int tmp;
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:
tmp = ms(adj[i][1], adj[i][2]);
C[i] = ms(ms(adj[i][0], tmp), tmp);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 |
15696 KB |
Output is correct |
3 |
Correct |
21 ms |
15444 KB |
Output is correct |
4 |
Correct |
6 ms |
11988 KB |
Output is correct |
5 |
Correct |
14 ms |
13140 KB |
Output is correct |
6 |
Correct |
35 ms |
17272 KB |
Output is correct |
7 |
Correct |
6 ms |
11956 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11988 KB |
Output is correct |
2 |
Correct |
24 ms |
15696 KB |
Output is correct |
3 |
Correct |
21 ms |
15444 KB |
Output is correct |
4 |
Correct |
6 ms |
11988 KB |
Output is correct |
5 |
Correct |
14 ms |
13140 KB |
Output is correct |
6 |
Correct |
35 ms |
17272 KB |
Output is correct |
7 |
Correct |
6 ms |
11956 KB |
Output is correct |
8 |
Correct |
38 ms |
18168 KB |
Output is correct |
9 |
Correct |
41 ms |
18576 KB |
Output is correct |
10 |
Correct |
55 ms |
21808 KB |
Output is correct |
11 |
Correct |
5 ms |
12048 KB |
Output is correct |
12 |
Correct |
5 ms |
11988 KB |
Output is correct |
13 |
Correct |
6 ms |
11988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
11988 KB |
Output is correct |
2 |
Correct |
24 ms |
15696 KB |
Output is correct |
3 |
Correct |
21 ms |
15444 KB |
Output is correct |
4 |
Correct |
6 ms |
11988 KB |
Output is correct |
5 |
Correct |
14 ms |
13140 KB |
Output is correct |
6 |
Correct |
35 ms |
17272 KB |
Output is correct |
7 |
Correct |
6 ms |
11956 KB |
Output is correct |
8 |
Correct |
38 ms |
18168 KB |
Output is correct |
9 |
Correct |
41 ms |
18576 KB |
Output is correct |
10 |
Correct |
55 ms |
21808 KB |
Output is correct |
11 |
Correct |
5 ms |
12048 KB |
Output is correct |
12 |
Correct |
5 ms |
11988 KB |
Output is correct |
13 |
Correct |
6 ms |
11988 KB |
Output is correct |
14 |
Incorrect |
67 ms |
23472 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 |
- |