#include <bits/stdc++.h>
using namespace std;
#include "swaps.h"
void solve(int n,int v){
int rnks[n+1];
for(int i = 1;i<=n;i++)rnks[i] = i;
bool odd = 0;
int its = v;
while(its--){
int st = odd+1;
for(;st<n;st+=2){
schedule(st,st+1);
}
vector<int> vis = visit();
st = odd+1;int ind = 0;
for(;st<n;st+=2){
if(!vis[ind])swap(rnks[st],rnks[st+1]);
ind++;
}
odd = !odd;
}vector<int> lol;
for(int i = 1;i<=n;i++){
lol.push_back(rnks[i]);
}
answer(lol);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
344 KB |
Correct |
2 |
Correct |
87 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
344 KB |
Correct |
2 |
Correct |
87 ms |
344 KB |
Correct |
3 |
Incorrect |
30 ms |
344 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
356 KB |
Correct |
2 |
Correct |
79 ms |
344 KB |
Correct |
3 |
Correct |
176 ms |
408 KB |
Correct |
4 |
Correct |
340 ms |
1876 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
356 KB |
Correct |
2 |
Correct |
79 ms |
344 KB |
Correct |
3 |
Correct |
176 ms |
408 KB |
Correct |
4 |
Correct |
340 ms |
1876 KB |
Correct |
5 |
Incorrect |
27 ms |
596 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
98 ms |
344 KB |
Correct |
3 |
Correct |
183 ms |
412 KB |
Correct |
4 |
Correct |
327 ms |
1764 KB |
Correct |
5 |
Correct |
32 ms |
1164 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
98 ms |
344 KB |
Correct |
3 |
Correct |
183 ms |
412 KB |
Correct |
4 |
Correct |
327 ms |
1764 KB |
Correct |
5 |
Correct |
32 ms |
1164 KB |
Correct |
6 |
Incorrect |
27 ms |
344 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
82 ms |
344 KB |
Correct |
3 |
Correct |
170 ms |
412 KB |
Correct |
4 |
Correct |
323 ms |
1908 KB |
Correct |
5 |
Correct |
33 ms |
1424 KB |
Correct |
6 |
Incorrect |
7 ms |
736 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
344 KB |
Correct |
2 |
Correct |
82 ms |
344 KB |
Correct |
3 |
Correct |
170 ms |
412 KB |
Correct |
4 |
Correct |
323 ms |
1908 KB |
Correct |
5 |
Correct |
33 ms |
1424 KB |
Correct |
6 |
Incorrect |
7 ms |
736 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
90 ms |
344 KB |
Correct |
3 |
Correct |
172 ms |
416 KB |
Correct |
4 |
Correct |
328 ms |
2168 KB |
Correct |
5 |
Correct |
33 ms |
1416 KB |
Correct |
6 |
Incorrect |
7 ms |
1052 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
344 KB |
Correct |
2 |
Correct |
90 ms |
344 KB |
Correct |
3 |
Correct |
172 ms |
416 KB |
Correct |
4 |
Correct |
328 ms |
2168 KB |
Correct |
5 |
Correct |
33 ms |
1416 KB |
Correct |
6 |
Incorrect |
7 ms |
1052 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |