#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 < v; 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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
38 ms |
344 KB |
Correct |
2 |
Correct |
83 ms |
344 KB |
Correct |
3 |
Correct |
161 ms |
412 KB |
Correct |
4 |
Correct |
312 ms |
1720 KB |
Correct |
5 |
Correct |
309 ms |
1740 KB |
Correct |
6 |
Correct |
304 ms |
1672 KB |
Correct |
7 |
Correct |
311 ms |
1852 KB |
Correct |
8 |
Correct |
315 ms |
1844 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
344 KB |
Correct |
2 |
Correct |
75 ms |
344 KB |
Correct |
3 |
Correct |
163 ms |
412 KB |
Correct |
4 |
Correct |
310 ms |
1716 KB |
Correct |
5 |
Correct |
303 ms |
1868 KB |
Correct |
6 |
Correct |
307 ms |
1768 KB |
Correct |
7 |
Correct |
311 ms |
1860 KB |
Correct |
8 |
Correct |
308 ms |
1680 KB |
Correct |
9 |
Correct |
63 ms |
916 KB |
Correct |
10 |
Correct |
61 ms |
1172 KB |
Correct |
11 |
Correct |
63 ms |
1172 KB |
Correct |
12 |
Correct |
62 ms |
1168 KB |
Correct |
13 |
Correct |
64 ms |
668 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
75 ms |
344 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
75 ms |
344 KB |
Correct |
3 |
Correct |
28 ms |
344 KB |
Correct |
4 |
Correct |
76 ms |
344 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
75 ms |
344 KB |
Correct |
3 |
Correct |
160 ms |
408 KB |
Correct |
4 |
Correct |
306 ms |
1808 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
75 ms |
344 KB |
Correct |
3 |
Correct |
160 ms |
408 KB |
Correct |
4 |
Correct |
306 ms |
1808 KB |
Correct |
5 |
Correct |
24 ms |
344 KB |
Correct |
6 |
Correct |
82 ms |
344 KB |
Correct |
7 |
Correct |
165 ms |
596 KB |
Correct |
8 |
Correct |
312 ms |
1804 KB |
Correct |
9 |
Correct |
321 ms |
1512 KB |
Correct |
10 |
Correct |
335 ms |
1420 KB |
Correct |
11 |
Correct |
323 ms |
1264 KB |
Correct |
12 |
Correct |
326 ms |
1556 KB |
Correct |
13 |
Correct |
23 ms |
344 KB |
Correct |
14 |
Correct |
80 ms |
344 KB |
Correct |
15 |
Correct |
173 ms |
408 KB |
Correct |
16 |
Correct |
330 ms |
1712 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
344 KB |
Correct |
2 |
Correct |
73 ms |
344 KB |
Correct |
3 |
Correct |
159 ms |
416 KB |
Correct |
4 |
Correct |
306 ms |
1708 KB |
Correct |
5 |
Correct |
31 ms |
916 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
28 ms |
344 KB |
Correct |
2 |
Correct |
73 ms |
344 KB |
Correct |
3 |
Correct |
159 ms |
416 KB |
Correct |
4 |
Correct |
306 ms |
1708 KB |
Correct |
5 |
Correct |
31 ms |
916 KB |
Correct |
6 |
Correct |
27 ms |
344 KB |
Correct |
7 |
Correct |
73 ms |
344 KB |
Correct |
8 |
Correct |
162 ms |
412 KB |
Correct |
9 |
Correct |
312 ms |
1904 KB |
Correct |
10 |
Correct |
305 ms |
1784 KB |
Correct |
11 |
Correct |
307 ms |
1660 KB |
Correct |
12 |
Correct |
312 ms |
1740 KB |
Correct |
13 |
Correct |
308 ms |
1824 KB |
Correct |
14 |
Correct |
63 ms |
1668 KB |
Correct |
15 |
Correct |
62 ms |
1444 KB |
Correct |
16 |
Correct |
62 ms |
1444 KB |
Correct |
17 |
Correct |
62 ms |
1168 KB |
Correct |
18 |
Correct |
64 ms |
1424 KB |
Correct |
19 |
Correct |
27 ms |
344 KB |
Correct |
20 |
Correct |
82 ms |
344 KB |
Correct |
21 |
Correct |
171 ms |
416 KB |
Correct |
22 |
Correct |
316 ms |
1864 KB |
Correct |
23 |
Correct |
37 ms |
1172 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
80 ms |
340 KB |
Correct |
3 |
Correct |
163 ms |
412 KB |
Correct |
4 |
Correct |
305 ms |
1580 KB |
Correct |
5 |
Correct |
30 ms |
916 KB |
Correct |
6 |
Incorrect |
6 ms |
668 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
80 ms |
340 KB |
Correct |
3 |
Correct |
163 ms |
412 KB |
Correct |
4 |
Correct |
305 ms |
1580 KB |
Correct |
5 |
Correct |
30 ms |
916 KB |
Correct |
6 |
Incorrect |
6 ms |
668 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
344 KB |
Correct |
2 |
Correct |
89 ms |
344 KB |
Correct |
3 |
Correct |
176 ms |
412 KB |
Correct |
4 |
Correct |
312 ms |
1528 KB |
Correct |
5 |
Correct |
30 ms |
692 KB |
Correct |
6 |
Incorrect |
7 ms |
1080 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
31 ms |
344 KB |
Correct |
2 |
Correct |
89 ms |
344 KB |
Correct |
3 |
Correct |
176 ms |
412 KB |
Correct |
4 |
Correct |
312 ms |
1528 KB |
Correct |
5 |
Correct |
30 ms |
692 KB |
Correct |
6 |
Incorrect |
7 ms |
1080 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |