#include <bits/stdc++.h>
#include "swaps.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
typedef int64_t ll;
void solve(int n, int v) {
vector<int> a(n);
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
for (int cur = 0; cur < n; cur++) {
for (int i = (cur & 1); i + 1 < n; i += 2) {
schedule(a[i], a[i + 1]);
}
vector<int> ret = visit();
int idx = 0;
for (int i = (cur & 1); i + 1 < n; i += 2) {
if (!ret[idx]) {
swap(a[i], a[i + 1]);
}
idx++;
}
}
answer(a);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
424 KB |
Correct |
4 |
Correct |
31 ms |
1168 KB |
Correct |
5 |
Correct |
31 ms |
1172 KB |
Correct |
6 |
Correct |
31 ms |
940 KB |
Correct |
7 |
Correct |
32 ms |
1168 KB |
Correct |
8 |
Correct |
32 ms |
920 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
8 ms |
428 KB |
Correct |
4 |
Correct |
32 ms |
944 KB |
Correct |
5 |
Correct |
34 ms |
668 KB |
Correct |
6 |
Correct |
32 ms |
944 KB |
Correct |
7 |
Correct |
33 ms |
1192 KB |
Correct |
8 |
Correct |
35 ms |
1176 KB |
Correct |
9 |
Correct |
35 ms |
1432 KB |
Correct |
10 |
Correct |
31 ms |
920 KB |
Correct |
11 |
Correct |
31 ms |
940 KB |
Correct |
12 |
Correct |
32 ms |
1668 KB |
Correct |
13 |
Correct |
43 ms |
1692 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
4 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
4 ms |
344 KB |
Correct |
3 |
Correct |
1 ms |
344 KB |
Correct |
4 |
Correct |
2 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
428 KB |
Correct |
4 |
Correct |
37 ms |
1168 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
428 KB |
Correct |
4 |
Correct |
37 ms |
1168 KB |
Correct |
5 |
Correct |
1 ms |
344 KB |
Correct |
6 |
Correct |
2 ms |
344 KB |
Correct |
7 |
Correct |
9 ms |
428 KB |
Correct |
8 |
Correct |
33 ms |
916 KB |
Correct |
9 |
Correct |
32 ms |
1148 KB |
Correct |
10 |
Correct |
36 ms |
920 KB |
Correct |
11 |
Correct |
33 ms |
1164 KB |
Correct |
12 |
Correct |
32 ms |
916 KB |
Correct |
13 |
Correct |
0 ms |
344 KB |
Correct |
14 |
Correct |
2 ms |
344 KB |
Correct |
15 |
Correct |
9 ms |
412 KB |
Correct |
16 |
Correct |
33 ms |
1192 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
356 KB |
Correct |
3 |
Correct |
9 ms |
424 KB |
Correct |
4 |
Correct |
36 ms |
920 KB |
Correct |
5 |
Correct |
31 ms |
940 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
356 KB |
Correct |
3 |
Correct |
9 ms |
424 KB |
Correct |
4 |
Correct |
36 ms |
920 KB |
Correct |
5 |
Correct |
31 ms |
940 KB |
Correct |
6 |
Correct |
1 ms |
344 KB |
Correct |
7 |
Correct |
2 ms |
344 KB |
Correct |
8 |
Correct |
9 ms |
436 KB |
Correct |
9 |
Correct |
33 ms |
1440 KB |
Correct |
10 |
Correct |
32 ms |
1424 KB |
Correct |
11 |
Correct |
31 ms |
1184 KB |
Correct |
12 |
Correct |
32 ms |
928 KB |
Correct |
13 |
Correct |
33 ms |
1172 KB |
Correct |
14 |
Correct |
34 ms |
920 KB |
Correct |
15 |
Correct |
31 ms |
1928 KB |
Correct |
16 |
Correct |
32 ms |
1452 KB |
Correct |
17 |
Correct |
40 ms |
1192 KB |
Correct |
18 |
Correct |
37 ms |
944 KB |
Correct |
19 |
Correct |
0 ms |
344 KB |
Correct |
20 |
Correct |
2 ms |
344 KB |
Correct |
21 |
Correct |
12 ms |
428 KB |
Correct |
22 |
Correct |
35 ms |
1424 KB |
Correct |
23 |
Correct |
36 ms |
1172 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
8 ms |
428 KB |
Correct |
4 |
Correct |
33 ms |
1188 KB |
Correct |
5 |
Correct |
33 ms |
1172 KB |
Correct |
6 |
Runtime error |
7 ms |
1184 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
8 ms |
428 KB |
Correct |
4 |
Correct |
33 ms |
1188 KB |
Correct |
5 |
Correct |
33 ms |
1172 KB |
Correct |
6 |
Runtime error |
7 ms |
1184 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
436 KB |
Correct |
4 |
Correct |
32 ms |
664 KB |
Correct |
5 |
Correct |
33 ms |
1168 KB |
Correct |
6 |
Runtime error |
7 ms |
592 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
436 KB |
Correct |
4 |
Correct |
32 ms |
664 KB |
Correct |
5 |
Correct |
33 ms |
1168 KB |
Correct |
6 |
Runtime error |
7 ms |
592 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |