#include "swaps.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int ans[1010];
void solve(int N, int V) {
int n = N;
for (int i=1;i<=n;i++) ans[i] = i;
for (int z=1;z<=n;z++){
for (int i=2-(z&1);i+1<=n;i+=2){
schedule(ans[i], ans[i+1]);
}
auto ret = visit();
for (int i=2-(z&1),j=0;i+1<=n;i+=2,j++){
if (!ret[j]) swap(ans[i], ans[i+1]);
}
}
vector<int> rans;
for (int i=1;i<=n;i++) rans.push_back(ans[i]);
answer(rans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
10 ms |
280 KB |
Correct |
4 |
Correct |
34 ms |
344 KB |
Correct |
5 |
Correct |
38 ms |
300 KB |
Correct |
6 |
Correct |
38 ms |
300 KB |
Correct |
7 |
Correct |
48 ms |
300 KB |
Correct |
8 |
Correct |
34 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
236 KB |
Correct |
3 |
Correct |
10 ms |
208 KB |
Correct |
4 |
Correct |
43 ms |
388 KB |
Correct |
5 |
Correct |
33 ms |
300 KB |
Correct |
6 |
Correct |
35 ms |
304 KB |
Correct |
7 |
Correct |
43 ms |
300 KB |
Correct |
8 |
Correct |
44 ms |
508 KB |
Correct |
9 |
Correct |
37 ms |
380 KB |
Correct |
10 |
Correct |
35 ms |
300 KB |
Correct |
11 |
Correct |
35 ms |
308 KB |
Correct |
12 |
Correct |
34 ms |
300 KB |
Correct |
13 |
Correct |
36 ms |
308 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
0 ms |
208 KB |
Correct |
4 |
Correct |
2 ms |
208 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
9 ms |
284 KB |
Correct |
4 |
Correct |
33 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
9 ms |
284 KB |
Correct |
4 |
Correct |
33 ms |
304 KB |
Correct |
5 |
Correct |
0 ms |
208 KB |
Correct |
6 |
Correct |
3 ms |
208 KB |
Correct |
7 |
Correct |
10 ms |
208 KB |
Correct |
8 |
Correct |
35 ms |
304 KB |
Correct |
9 |
Correct |
40 ms |
304 KB |
Correct |
10 |
Correct |
33 ms |
304 KB |
Correct |
11 |
Correct |
47 ms |
480 KB |
Correct |
12 |
Correct |
34 ms |
300 KB |
Correct |
13 |
Correct |
0 ms |
208 KB |
Correct |
14 |
Correct |
3 ms |
208 KB |
Correct |
15 |
Correct |
9 ms |
280 KB |
Correct |
16 |
Correct |
36 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
10 ms |
208 KB |
Correct |
4 |
Correct |
42 ms |
300 KB |
Correct |
5 |
Correct |
34 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
10 ms |
208 KB |
Correct |
4 |
Correct |
42 ms |
300 KB |
Correct |
5 |
Correct |
34 ms |
304 KB |
Correct |
6 |
Correct |
0 ms |
208 KB |
Correct |
7 |
Correct |
2 ms |
208 KB |
Correct |
8 |
Correct |
10 ms |
208 KB |
Correct |
9 |
Correct |
33 ms |
300 KB |
Correct |
10 |
Correct |
35 ms |
304 KB |
Correct |
11 |
Correct |
33 ms |
300 KB |
Correct |
12 |
Correct |
34 ms |
304 KB |
Correct |
13 |
Correct |
33 ms |
304 KB |
Correct |
14 |
Correct |
33 ms |
304 KB |
Correct |
15 |
Correct |
40 ms |
444 KB |
Correct |
16 |
Correct |
34 ms |
300 KB |
Correct |
17 |
Correct |
35 ms |
304 KB |
Correct |
18 |
Correct |
42 ms |
304 KB |
Correct |
19 |
Correct |
0 ms |
208 KB |
Correct |
20 |
Correct |
2 ms |
336 KB |
Correct |
21 |
Correct |
10 ms |
284 KB |
Correct |
22 |
Correct |
41 ms |
304 KB |
Correct |
23 |
Correct |
38 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
300 KB |
Correct |
3 |
Correct |
13 ms |
208 KB |
Correct |
4 |
Correct |
42 ms |
304 KB |
Correct |
5 |
Correct |
36 ms |
304 KB |
Correct |
6 |
Runtime error |
9 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
300 KB |
Correct |
3 |
Correct |
13 ms |
208 KB |
Correct |
4 |
Correct |
42 ms |
304 KB |
Correct |
5 |
Correct |
36 ms |
304 KB |
Correct |
6 |
Runtime error |
9 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
10 ms |
280 KB |
Correct |
4 |
Correct |
42 ms |
300 KB |
Correct |
5 |
Correct |
32 ms |
296 KB |
Correct |
6 |
Runtime error |
7 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
10 ms |
280 KB |
Correct |
4 |
Correct |
42 ms |
300 KB |
Correct |
5 |
Correct |
32 ms |
296 KB |
Correct |
6 |
Runtime error |
7 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |