#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*2;
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 |
0 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 |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
3 |
Incorrect |
1 ms |
344 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
3 |
Correct |
22 ms |
412 KB |
Correct |
4 |
Correct |
68 ms |
1420 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
3 ms |
344 KB |
Correct |
3 |
Correct |
22 ms |
412 KB |
Correct |
4 |
Correct |
68 ms |
1420 KB |
Correct |
5 |
Incorrect |
1 ms |
496 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
4 ms |
344 KB |
Correct |
3 |
Correct |
20 ms |
416 KB |
Correct |
4 |
Correct |
68 ms |
1172 KB |
Correct |
5 |
Runtime error |
34 ms |
940 KB |
Execution killed with signal 13 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
4 ms |
344 KB |
Correct |
3 |
Correct |
20 ms |
416 KB |
Correct |
4 |
Correct |
68 ms |
1172 KB |
Correct |
5 |
Runtime error |
34 ms |
940 KB |
Execution killed with signal 13 |
6 |
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 |
17 ms |
432 KB |
Correct |
4 |
Correct |
72 ms |
1420 KB |
Correct |
5 |
Runtime error |
36 ms |
1168 KB |
Execution killed with signal 13 |
6 |
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 |
17 ms |
432 KB |
Correct |
4 |
Correct |
72 ms |
1420 KB |
Correct |
5 |
Runtime error |
36 ms |
1168 KB |
Execution killed with signal 13 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
5 ms |
344 KB |
Correct |
3 |
Correct |
21 ms |
412 KB |
Correct |
4 |
Correct |
70 ms |
1660 KB |
Correct |
5 |
Runtime error |
32 ms |
1172 KB |
Execution killed with signal 13 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Correct |
5 ms |
344 KB |
Correct |
3 |
Correct |
21 ms |
412 KB |
Correct |
4 |
Correct |
70 ms |
1660 KB |
Correct |
5 |
Runtime error |
32 ms |
1172 KB |
Execution killed with signal 13 |
6 |
Halted |
0 ms |
0 KB |
- |