#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(a) (a).begin(), (a).end()
template<typename T>
int len(T &a){
return a.size();
}
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
void create_circuit(int m, vector<int> a) {
int n = a.size();
vector<int> c(m + 1);
a.push_back(0);
c[0] = a[0];
vector<vector<int>> pos(m + 1);
for(int i = 0; i < n; i ++){
pos[a[i]].push_back(i);
}
vector<int> x, y;
for(int i = 1; i <= m; i ++){
if(len(pos[i]) == 0) continue;
if(len(pos[i]) == 1){
c[i] = a[pos[i][0] + 1];
continue;
}
x.push_back(a[pos[i][0] + 1]); y.push_back(a[pos[i][1] + 1]);
c[i] = -len(x);
}
answer(c, x, y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
16 ms |
6484 KB |
Output is correct |
3 |
Correct |
14 ms |
5204 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
6 ms |
3932 KB |
Output is correct |
6 |
Correct |
24 ms |
7632 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
16 ms |
6484 KB |
Output is correct |
3 |
Correct |
14 ms |
5204 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
6 ms |
3932 KB |
Output is correct |
6 |
Correct |
24 ms |
7632 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
27 ms |
7256 KB |
Output is correct |
9 |
Correct |
39 ms |
9560 KB |
Output is correct |
10 |
Correct |
58 ms |
12716 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 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
16 ms |
6484 KB |
Output is correct |
3 |
Correct |
14 ms |
5204 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
6 ms |
3932 KB |
Output is correct |
6 |
Correct |
24 ms |
7632 KB |
Output is correct |
7 |
Correct |
0 ms |
344 KB |
Output is correct |
8 |
Correct |
27 ms |
7256 KB |
Output is correct |
9 |
Correct |
39 ms |
9560 KB |
Output is correct |
10 |
Correct |
58 ms |
12716 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 |
36 ms |
9732 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |