#include <bits/stdc++.h>
#include "swaps.h"
using namespace std;
void solve (int n, int v) {
vector <int> arr;
for (int i = 1; i <= n; i++) {
arr.push_back(i);
}
for (int i = 0; i < n; i++) {
for (int j = (i & 1); j + 1 < n; j += 2) {
schedule(arr[j], arr[j + 1]);
}
auto x = visit();
int cnt = -1;
for (int j = (i & 1); j + 1 < n; j += 2) {
cnt++;
if (!x[cnt]) {
swap(arr[j + 1], arr[j]);
}
}
}
answer(arr);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
344 KB |
Correct |
4 |
Correct |
34 ms |
1172 KB |
Correct |
5 |
Correct |
33 ms |
936 KB |
Correct |
6 |
Correct |
34 ms |
1196 KB |
Correct |
7 |
Correct |
40 ms |
664 KB |
Correct |
8 |
Correct |
33 ms |
944 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
344 KB |
Correct |
4 |
Correct |
33 ms |
916 KB |
Correct |
5 |
Correct |
33 ms |
1424 KB |
Correct |
6 |
Correct |
33 ms |
920 KB |
Correct |
7 |
Correct |
34 ms |
1168 KB |
Correct |
8 |
Correct |
34 ms |
1420 KB |
Correct |
9 |
Correct |
37 ms |
1176 KB |
Correct |
10 |
Correct |
32 ms |
936 KB |
Correct |
11 |
Correct |
33 ms |
1172 KB |
Correct |
12 |
Correct |
33 ms |
1176 KB |
Correct |
13 |
Correct |
33 ms |
944 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
0 ms |
344 KB |
Correct |
4 |
Correct |
2 ms |
600 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 |
344 KB |
Correct |
4 |
Correct |
33 ms |
1192 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 |
344 KB |
Correct |
4 |
Correct |
33 ms |
1192 KB |
Correct |
5 |
Correct |
0 ms |
344 KB |
Correct |
6 |
Correct |
2 ms |
344 KB |
Correct |
7 |
Correct |
9 ms |
344 KB |
Correct |
8 |
Correct |
33 ms |
668 KB |
Correct |
9 |
Correct |
33 ms |
1444 KB |
Correct |
10 |
Correct |
33 ms |
1420 KB |
Correct |
11 |
Correct |
33 ms |
1184 KB |
Correct |
12 |
Correct |
33 ms |
920 KB |
Correct |
13 |
Correct |
0 ms |
344 KB |
Correct |
14 |
Correct |
2 ms |
600 KB |
Correct |
15 |
Correct |
10 ms |
344 KB |
Correct |
16 |
Correct |
35 ms |
1172 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 |
344 KB |
Correct |
4 |
Correct |
39 ms |
692 KB |
Correct |
5 |
Correct |
33 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 |
9 ms |
344 KB |
Correct |
4 |
Correct |
39 ms |
692 KB |
Correct |
5 |
Correct |
33 ms |
920 KB |
Correct |
6 |
Correct |
0 ms |
344 KB |
Correct |
7 |
Correct |
2 ms |
344 KB |
Correct |
8 |
Correct |
9 ms |
344 KB |
Correct |
9 |
Correct |
35 ms |
916 KB |
Correct |
10 |
Correct |
34 ms |
688 KB |
Correct |
11 |
Correct |
33 ms |
692 KB |
Correct |
12 |
Correct |
33 ms |
1424 KB |
Correct |
13 |
Correct |
36 ms |
668 KB |
Correct |
14 |
Correct |
33 ms |
920 KB |
Correct |
15 |
Correct |
33 ms |
1172 KB |
Correct |
16 |
Correct |
33 ms |
688 KB |
Correct |
17 |
Correct |
36 ms |
1192 KB |
Correct |
18 |
Correct |
33 ms |
1168 KB |
Correct |
19 |
Correct |
0 ms |
344 KB |
Correct |
20 |
Correct |
2 ms |
344 KB |
Correct |
21 |
Correct |
9 ms |
344 KB |
Correct |
22 |
Correct |
34 ms |
668 KB |
Correct |
23 |
Correct |
35 ms |
1188 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 |
344 KB |
Correct |
4 |
Correct |
34 ms |
688 KB |
Correct |
5 |
Correct |
33 ms |
696 KB |
Correct |
6 |
Runtime error |
7 ms |
680 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
344 KB |
Correct |
4 |
Correct |
34 ms |
688 KB |
Correct |
5 |
Correct |
33 ms |
696 KB |
Correct |
6 |
Runtime error |
7 ms |
680 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
596 KB |
Correct |
3 |
Correct |
9 ms |
344 KB |
Correct |
4 |
Correct |
33 ms |
1176 KB |
Correct |
5 |
Correct |
33 ms |
916 KB |
Correct |
6 |
Runtime error |
7 ms |
912 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
596 KB |
Correct |
3 |
Correct |
9 ms |
344 KB |
Correct |
4 |
Correct |
33 ms |
1176 KB |
Correct |
5 |
Correct |
33 ms |
916 KB |
Correct |
6 |
Runtime error |
7 ms |
912 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |