#include <bits/stdc++.h>
#include "doll.h"
using namespace std;
#define out(o) cout << o
void create_circuit(int M, vector<int> A) {
int N = A.size();
A.push_back(0);
vector<vector<int>> occ(M + 1);
for (int i = 0; i < N; i++) occ[A[i]].push_back(i);
vector<int> C(M + 1, 0);
vector<int> X;
vector<int> Y;
int S = 0;
C[0] = A[0];
for (int i = 0; i < N; i++) {
if (occ[A[i]].size() == 1 || A[occ[A[i]][0] + 1] == A[occ[A[i]][1] + 1]) C[A[i]] = A[i + 1];
else if (occ[A[i]][0] == i) {
S++;
X.push_back(A[i + 1]);
Y.push_back(A[occ[A[i]][1] + 1]);
C[A[i]] = -S;
}
}
answer(C, X, Y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
14 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
6032 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
5 ms |
3932 KB |
Output is correct |
6 |
Correct |
25 ms |
8392 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
14 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
6032 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
5 ms |
3932 KB |
Output is correct |
6 |
Correct |
25 ms |
8392 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
25 ms |
8012 KB |
Output is correct |
9 |
Correct |
31 ms |
9560 KB |
Output is correct |
10 |
Correct |
47 ms |
12776 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
14 ms |
6868 KB |
Output is correct |
3 |
Correct |
11 ms |
6032 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
5 ms |
3932 KB |
Output is correct |
6 |
Correct |
25 ms |
8392 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
25 ms |
8012 KB |
Output is correct |
9 |
Correct |
31 ms |
9560 KB |
Output is correct |
10 |
Correct |
47 ms |
12776 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Incorrect |
35 ms |
9804 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |