#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+1,st);
}
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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Incorrect |
1 ms |
344 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
33 ms |
684 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
33 ms |
684 KB |
Correct |
5 |
Incorrect |
0 ms |
344 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
596 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
428 KB |
Correct |
4 |
Correct |
33 ms |
1164 KB |
Correct |
5 |
Correct |
34 ms |
1192 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
596 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
428 KB |
Correct |
4 |
Correct |
33 ms |
1164 KB |
Correct |
5 |
Correct |
34 ms |
1192 KB |
Correct |
6 |
Incorrect |
0 ms |
344 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
412 KB |
Correct |
4 |
Correct |
37 ms |
1672 KB |
Correct |
5 |
Correct |
33 ms |
940 KB |
Correct |
6 |
Runtime error |
7 ms |
632 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
352 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
10 ms |
412 KB |
Correct |
4 |
Correct |
37 ms |
1672 KB |
Correct |
5 |
Correct |
33 ms |
940 KB |
Correct |
6 |
Runtime error |
7 ms |
632 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
11 ms |
432 KB |
Correct |
4 |
Correct |
35 ms |
916 KB |
Correct |
5 |
Correct |
32 ms |
916 KB |
Correct |
6 |
Runtime error |
7 ms |
424 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Correct |
2 ms |
344 KB |
Correct |
3 |
Correct |
11 ms |
432 KB |
Correct |
4 |
Correct |
35 ms |
916 KB |
Correct |
5 |
Correct |
32 ms |
916 KB |
Correct |
6 |
Runtime error |
7 ms |
424 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |