#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 = n;
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 |
1 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
512 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
512 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Incorrect |
0 ms |
344 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
436 KB |
Correct |
4 |
Correct |
32 ms |
1172 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
436 KB |
Correct |
4 |
Correct |
32 ms |
1172 KB |
Correct |
5 |
Incorrect |
1 ms |
344 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
512 KB |
Correct |
3 |
Correct |
10 ms |
424 KB |
Correct |
4 |
Correct |
35 ms |
1420 KB |
Correct |
5 |
Correct |
34 ms |
1660 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
512 KB |
Correct |
3 |
Correct |
10 ms |
424 KB |
Correct |
4 |
Correct |
35 ms |
1420 KB |
Correct |
5 |
Correct |
34 ms |
1660 KB |
Correct |
6 |
Incorrect |
0 ms |
344 KB |
Not correct |
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 |
412 KB |
Correct |
4 |
Correct |
34 ms |
1184 KB |
Correct |
5 |
Correct |
38 ms |
1164 KB |
Correct |
6 |
Runtime error |
7 ms |
608 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 |
412 KB |
Correct |
4 |
Correct |
34 ms |
1184 KB |
Correct |
5 |
Correct |
38 ms |
1164 KB |
Correct |
6 |
Runtime error |
7 ms |
608 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 |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
420 KB |
Correct |
4 |
Correct |
34 ms |
684 KB |
Correct |
5 |
Correct |
32 ms |
660 KB |
Correct |
6 |
Runtime error |
7 ms |
940 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 |
2 ms |
344 KB |
Correct |
3 |
Correct |
9 ms |
420 KB |
Correct |
4 |
Correct |
34 ms |
684 KB |
Correct |
5 |
Correct |
32 ms |
660 KB |
Correct |
6 |
Runtime error |
7 ms |
940 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |