#include <bits/stdc++.h>
using namespace std;
#include "swaps.h"
void solve(int n, int v) {
vector<int> sus;
vector<int> res;
for (int i=1;i<=n;i++) sus.push_back(i);
for (int t=0;t<9;t++) for (int k=t;k>=0;k--) {
for (int i=0;i<n;i++) if ((((i>>k)&1)==(k-t!=0)) && (i+(1<<k)<n) && (((i+(1<<k))>>(t+1))==(i>>(t+1)))) {
schedule(sus[i],sus[i+(1<<k)]);
}
res=visit();
int j=0;
for (int i=0;i<n;i++) if ((((i>>k)&1)==(k-t!=0)) && (i+(1<<k)<n) && (((i+(1<<k))>>(t+1))==(i>>(t+1)))) {
if (res[j]==0) swap(sus[i],sus[i+(1<<k)]);
j++;
}
}
answer(sus);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
3 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
300 KB |
Correct |
5 |
Correct |
4 ms |
308 KB |
Correct |
6 |
Correct |
4 ms |
304 KB |
Correct |
7 |
Correct |
4 ms |
304 KB |
Correct |
8 |
Correct |
4 ms |
292 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
3 ms |
296 KB |
Correct |
4 |
Correct |
4 ms |
304 KB |
Correct |
5 |
Correct |
4 ms |
296 KB |
Correct |
6 |
Correct |
6 ms |
304 KB |
Correct |
7 |
Correct |
3 ms |
308 KB |
Correct |
8 |
Correct |
4 ms |
304 KB |
Correct |
9 |
Correct |
4 ms |
300 KB |
Correct |
10 |
Correct |
4 ms |
300 KB |
Correct |
11 |
Correct |
4 ms |
312 KB |
Correct |
12 |
Correct |
3 ms |
304 KB |
Correct |
13 |
Correct |
6 ms |
296 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
2 ms |
200 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
2 ms |
200 KB |
Correct |
3 |
Correct |
1 ms |
200 KB |
Correct |
4 |
Correct |
2 ms |
200 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
300 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
300 KB |
Correct |
5 |
Correct |
1 ms |
200 KB |
Correct |
6 |
Correct |
3 ms |
200 KB |
Correct |
7 |
Correct |
3 ms |
200 KB |
Correct |
8 |
Correct |
4 ms |
296 KB |
Correct |
9 |
Correct |
4 ms |
304 KB |
Correct |
10 |
Correct |
4 ms |
300 KB |
Correct |
11 |
Correct |
5 ms |
300 KB |
Correct |
12 |
Correct |
4 ms |
304 KB |
Correct |
13 |
Correct |
1 ms |
200 KB |
Correct |
14 |
Correct |
1 ms |
200 KB |
Correct |
15 |
Correct |
2 ms |
296 KB |
Correct |
16 |
Correct |
6 ms |
300 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
3 ms |
292 KB |
Correct |
4 |
Correct |
5 ms |
304 KB |
Correct |
5 |
Correct |
4 ms |
284 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
3 ms |
292 KB |
Correct |
4 |
Correct |
5 ms |
304 KB |
Correct |
5 |
Correct |
4 ms |
284 KB |
Correct |
6 |
Correct |
1 ms |
200 KB |
Correct |
7 |
Correct |
2 ms |
200 KB |
Correct |
8 |
Correct |
3 ms |
200 KB |
Correct |
9 |
Correct |
4 ms |
304 KB |
Correct |
10 |
Correct |
4 ms |
300 KB |
Correct |
11 |
Correct |
6 ms |
300 KB |
Correct |
12 |
Correct |
4 ms |
300 KB |
Correct |
13 |
Correct |
4 ms |
304 KB |
Correct |
14 |
Correct |
4 ms |
296 KB |
Correct |
15 |
Correct |
5 ms |
316 KB |
Correct |
16 |
Correct |
4 ms |
304 KB |
Correct |
17 |
Correct |
4 ms |
300 KB |
Correct |
18 |
Correct |
5 ms |
304 KB |
Correct |
19 |
Correct |
1 ms |
200 KB |
Correct |
20 |
Correct |
1 ms |
200 KB |
Correct |
21 |
Correct |
2 ms |
200 KB |
Correct |
22 |
Correct |
4 ms |
304 KB |
Correct |
23 |
Correct |
3 ms |
284 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
308 KB |
Correct |
5 |
Correct |
4 ms |
272 KB |
Correct |
6 |
Correct |
4 ms |
272 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
308 KB |
Correct |
5 |
Correct |
4 ms |
272 KB |
Correct |
6 |
Correct |
4 ms |
272 KB |
Correct |
7 |
Correct |
1 ms |
200 KB |
Correct |
8 |
Correct |
1 ms |
200 KB |
Correct |
9 |
Correct |
2 ms |
200 KB |
Correct |
10 |
Correct |
5 ms |
304 KB |
Correct |
11 |
Correct |
4 ms |
420 KB |
Correct |
12 |
Correct |
4 ms |
304 KB |
Correct |
13 |
Correct |
4 ms |
304 KB |
Correct |
14 |
Correct |
4 ms |
304 KB |
Correct |
15 |
Correct |
4 ms |
308 KB |
Correct |
16 |
Correct |
4 ms |
304 KB |
Correct |
17 |
Correct |
4 ms |
300 KB |
Correct |
18 |
Correct |
4 ms |
304 KB |
Correct |
19 |
Correct |
4 ms |
308 KB |
Correct |
20 |
Correct |
1 ms |
200 KB |
Correct |
21 |
Correct |
2 ms |
200 KB |
Correct |
22 |
Correct |
2 ms |
304 KB |
Correct |
23 |
Correct |
4 ms |
308 KB |
Correct |
24 |
Correct |
4 ms |
284 KB |
Correct |
25 |
Correct |
4 ms |
264 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
304 KB |
Correct |
5 |
Correct |
4 ms |
284 KB |
Correct |
6 |
Correct |
3 ms |
292 KB |
Correct |
7 |
Correct |
4 ms |
284 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
1 ms |
200 KB |
Correct |
3 |
Correct |
2 ms |
200 KB |
Correct |
4 |
Correct |
4 ms |
304 KB |
Correct |
5 |
Correct |
4 ms |
284 KB |
Correct |
6 |
Correct |
3 ms |
292 KB |
Correct |
7 |
Correct |
4 ms |
284 KB |
Correct |
8 |
Correct |
1 ms |
200 KB |
Correct |
9 |
Correct |
1 ms |
200 KB |
Correct |
10 |
Correct |
2 ms |
200 KB |
Correct |
11 |
Correct |
2 ms |
200 KB |
Correct |
12 |
Correct |
5 ms |
304 KB |
Correct |
13 |
Correct |
3 ms |
304 KB |
Correct |
14 |
Correct |
5 ms |
300 KB |
Correct |
15 |
Correct |
4 ms |
304 KB |
Correct |
16 |
Correct |
4 ms |
304 KB |
Correct |
17 |
Correct |
4 ms |
332 KB |
Correct |
18 |
Correct |
5 ms |
304 KB |
Correct |
19 |
Correct |
4 ms |
308 KB |
Correct |
20 |
Correct |
3 ms |
308 KB |
Correct |
21 |
Correct |
4 ms |
308 KB |
Correct |
22 |
Correct |
1 ms |
200 KB |
Correct |
23 |
Correct |
1 ms |
200 KB |
Correct |
24 |
Correct |
2 ms |
200 KB |
Correct |
25 |
Correct |
4 ms |
304 KB |
Correct |
26 |
Correct |
4 ms |
296 KB |
Correct |
27 |
Correct |
4 ms |
260 KB |
Correct |
28 |
Correct |
4 ms |
284 KB |
Correct |