#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void create_circuit(int m, std::vector<int> a) {
int p = 0;
a.push_back (0);
vector < vector < int > > adj (m + 1);
for (auto &x : a) adj[p].push_back (x), p = x;
vector < int > c (m + 1), x, y;
x.reserve (a.size () * 2);
y.reserve (a.size () * 2);
for (int i = 0; i <= m; ++i)
{
if (adj[i].empty ()) continue;
auto f = [&] (auto &self, int &p, int l, int r) -> void
{
if (l + 1 == r) p = adj[i][l];
else
{
int m = (l + r) / 2;
x.push_back (0), y.push_back (0);
p = -x.size ();
self (self, x.back (), l, m);
self (self, y.back (), m, r);
}
};
f (f, c[i], 0, adj[i].size ());
}
answer (c, x, y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6996 KB |
Output is correct |
3 |
Correct |
19 ms |
5724 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
11 ms |
4184 KB |
Output is correct |
6 |
Correct |
23 ms |
8404 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6996 KB |
Output is correct |
3 |
Correct |
19 ms |
5724 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
11 ms |
4184 KB |
Output is correct |
6 |
Correct |
23 ms |
8404 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
31 ms |
8280 KB |
Output is correct |
9 |
Correct |
34 ms |
9556 KB |
Output is correct |
10 |
Correct |
48 ms |
12352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6996 KB |
Output is correct |
3 |
Correct |
19 ms |
5724 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
11 ms |
4184 KB |
Output is correct |
6 |
Correct |
23 ms |
8404 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
31 ms |
8280 KB |
Output is correct |
9 |
Correct |
34 ms |
9556 KB |
Output is correct |
10 |
Correct |
48 ms |
12352 KB |
Output is correct |
11 |
Correct |
0 ms |
344 KB |
Output is correct |
12 |
Correct |
0 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
600 KB |
Output is correct |
14 |
Incorrect |
52 ms |
10976 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
436 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
436 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |