#include "swaps.h"
#include<bits/stdc++.h>
using namespace std;
void solve(int N, int V) {
int n=N;
vector<int> v(N); for(int i=0;i<N;i++) v[i]=i+1;
for(int i=1;i<=n;i++){
int j=2;
if(i%2) j=1;
for(int u=j;u<n;u+=2) schedule(v[u-1],v[u]);
vector<int> w = visit();
for(int u=j;u<n;u+=2) if(w[(u-1)/2]==0) swap(v[u],v[u-1]);
}
answer(v);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
1 ms |
344 KB |
Correct |
3 |
Correct |
6 ms |
344 KB |
Correct |
4 |
Correct |
20 ms |
444 KB |
Correct |
5 |
Correct |
19 ms |
436 KB |
Correct |
6 |
Correct |
20 ms |
580 KB |
Correct |
7 |
Correct |
20 ms |
424 KB |
Correct |
8 |
Correct |
21 ms |
440 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
5 ms |
436 KB |
Correct |
4 |
Correct |
21 ms |
1400 KB |
Correct |
5 |
Correct |
22 ms |
492 KB |
Correct |
6 |
Correct |
19 ms |
436 KB |
Correct |
7 |
Correct |
35 ms |
500 KB |
Correct |
8 |
Correct |
21 ms |
516 KB |
Correct |
9 |
Correct |
19 ms |
344 KB |
Correct |
10 |
Correct |
19 ms |
436 KB |
Correct |
11 |
Correct |
22 ms |
520 KB |
Correct |
12 |
Correct |
22 ms |
436 KB |
Correct |
13 |
Correct |
29 ms |
416 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
1 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
1 ms |
344 KB |
Correct |
3 |
Correct |
0 ms |
344 KB |
Correct |
4 |
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 |
9 ms |
436 KB |
Correct |
4 |
Correct |
19 ms |
600 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 |
436 KB |
Correct |
4 |
Correct |
19 ms |
600 KB |
Correct |
5 |
Correct |
0 ms |
344 KB |
Correct |
6 |
Correct |
1 ms |
344 KB |
Correct |
7 |
Correct |
5 ms |
432 KB |
Correct |
8 |
Correct |
20 ms |
440 KB |
Correct |
9 |
Correct |
19 ms |
436 KB |
Correct |
10 |
Correct |
19 ms |
440 KB |
Correct |
11 |
Correct |
20 ms |
788 KB |
Correct |
12 |
Correct |
24 ms |
1172 KB |
Correct |
13 |
Correct |
1 ms |
344 KB |
Correct |
14 |
Correct |
1 ms |
344 KB |
Correct |
15 |
Correct |
5 ms |
432 KB |
Correct |
16 |
Correct |
20 ms |
440 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
432 KB |
Correct |
4 |
Correct |
19 ms |
436 KB |
Correct |
5 |
Correct |
20 ms |
444 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
432 KB |
Correct |
4 |
Correct |
19 ms |
436 KB |
Correct |
5 |
Correct |
20 ms |
444 KB |
Correct |
6 |
Correct |
0 ms |
344 KB |
Correct |
7 |
Correct |
2 ms |
344 KB |
Correct |
8 |
Correct |
5 ms |
344 KB |
Correct |
9 |
Correct |
24 ms |
436 KB |
Correct |
10 |
Correct |
19 ms |
344 KB |
Correct |
11 |
Correct |
20 ms |
440 KB |
Correct |
12 |
Correct |
30 ms |
560 KB |
Correct |
13 |
Correct |
24 ms |
444 KB |
Correct |
14 |
Correct |
20 ms |
444 KB |
Correct |
15 |
Correct |
25 ms |
436 KB |
Correct |
16 |
Correct |
23 ms |
436 KB |
Correct |
17 |
Correct |
21 ms |
584 KB |
Correct |
18 |
Correct |
23 ms |
440 KB |
Correct |
19 |
Correct |
0 ms |
344 KB |
Correct |
20 |
Correct |
1 ms |
344 KB |
Correct |
21 |
Correct |
6 ms |
344 KB |
Correct |
22 |
Correct |
25 ms |
412 KB |
Correct |
23 |
Correct |
26 ms |
412 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
1 ms |
344 KB |
Correct |
3 |
Correct |
5 ms |
424 KB |
Correct |
4 |
Correct |
26 ms |
456 KB |
Correct |
5 |
Correct |
19 ms |
440 KB |
Correct |
6 |
Runtime error |
4 ms |
344 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 |
1 ms |
344 KB |
Correct |
3 |
Correct |
5 ms |
424 KB |
Correct |
4 |
Correct |
26 ms |
456 KB |
Correct |
5 |
Correct |
19 ms |
440 KB |
Correct |
6 |
Runtime error |
4 ms |
344 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 |
7 ms |
432 KB |
Correct |
4 |
Correct |
21 ms |
612 KB |
Correct |
5 |
Correct |
22 ms |
496 KB |
Correct |
6 |
Runtime error |
5 ms |
580 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 |
7 ms |
432 KB |
Correct |
4 |
Correct |
21 ms |
612 KB |
Correct |
5 |
Correct |
22 ms |
496 KB |
Correct |
6 |
Runtime error |
5 ms |
580 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |