#include "swaps.h"
#include <vector>
using namespace std;
void solve(int N, int V)
{
vector<int> r(N);
for(int i = 1; i <= N; i++) r[i - 1] = i;
for(int v = 1; v <= min(V, N); v++)
{
if(v % 2 == 0)
{
for(int i = 0; i+1 < N; i += 2) schedule(r[i], r[i+1]);
vector<int> C = visit();
for(int i = 0; i+1 < N; i += 2)
if(C[i/2] == 0)
swap(r[i+1], r[i]);
}
else
{
for(int i = 1; i+1 < N; i += 2) schedule(r[i], r[i+1]);
vector<int> C = visit();
for(int i = 1; i+1 < N; i += 2)
if(C[i/2] == 0)
swap(r[i+1], r[i]);
}
}
answer(r);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
18 ms |
200 KB |
Correct |
4 |
Correct |
62 ms |
280 KB |
Correct |
5 |
Correct |
47 ms |
284 KB |
Correct |
6 |
Correct |
48 ms |
324 KB |
Correct |
7 |
Correct |
51 ms |
284 KB |
Correct |
8 |
Correct |
62 ms |
284 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
14 ms |
320 KB |
Correct |
4 |
Correct |
50 ms |
348 KB |
Correct |
5 |
Correct |
63 ms |
284 KB |
Correct |
6 |
Correct |
50 ms |
368 KB |
Correct |
7 |
Correct |
67 ms |
424 KB |
Correct |
8 |
Correct |
50 ms |
280 KB |
Correct |
9 |
Correct |
54 ms |
296 KB |
Correct |
10 |
Correct |
58 ms |
280 KB |
Correct |
11 |
Correct |
47 ms |
280 KB |
Correct |
12 |
Correct |
52 ms |
284 KB |
Correct |
13 |
Correct |
51 ms |
284 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
1 ms |
200 KB |
Correct |
4 |
Correct |
3 ms |
200 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
16 ms |
260 KB |
Correct |
4 |
Correct |
60 ms |
448 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
16 ms |
260 KB |
Correct |
4 |
Correct |
60 ms |
448 KB |
Correct |
5 |
Correct |
1 ms |
200 KB |
Correct |
6 |
Correct |
3 ms |
200 KB |
Correct |
7 |
Correct |
19 ms |
256 KB |
Correct |
8 |
Correct |
49 ms |
280 KB |
Correct |
9 |
Correct |
51 ms |
280 KB |
Correct |
10 |
Correct |
49 ms |
372 KB |
Correct |
11 |
Correct |
62 ms |
280 KB |
Correct |
12 |
Correct |
50 ms |
284 KB |
Correct |
13 |
Correct |
0 ms |
200 KB |
Correct |
14 |
Correct |
4 ms |
200 KB |
Correct |
15 |
Correct |
14 ms |
200 KB |
Correct |
16 |
Correct |
53 ms |
324 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
14 ms |
260 KB |
Correct |
4 |
Correct |
51 ms |
320 KB |
Correct |
5 |
Correct |
54 ms |
356 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
14 ms |
260 KB |
Correct |
4 |
Correct |
51 ms |
320 KB |
Correct |
5 |
Correct |
54 ms |
356 KB |
Correct |
6 |
Correct |
0 ms |
200 KB |
Correct |
7 |
Correct |
3 ms |
200 KB |
Correct |
8 |
Correct |
13 ms |
200 KB |
Correct |
9 |
Correct |
51 ms |
280 KB |
Correct |
10 |
Correct |
65 ms |
284 KB |
Correct |
11 |
Correct |
48 ms |
288 KB |
Correct |
12 |
Correct |
55 ms |
376 KB |
Correct |
13 |
Correct |
50 ms |
284 KB |
Correct |
14 |
Correct |
49 ms |
288 KB |
Correct |
15 |
Correct |
51 ms |
372 KB |
Correct |
16 |
Correct |
49 ms |
280 KB |
Correct |
17 |
Correct |
67 ms |
284 KB |
Correct |
18 |
Correct |
50 ms |
336 KB |
Correct |
19 |
Correct |
0 ms |
200 KB |
Correct |
20 |
Correct |
3 ms |
200 KB |
Correct |
21 |
Correct |
19 ms |
256 KB |
Correct |
22 |
Correct |
56 ms |
388 KB |
Correct |
23 |
Correct |
53 ms |
264 KB |
Correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
13 ms |
260 KB |
Correct |
4 |
Correct |
55 ms |
284 KB |
Correct |
5 |
Correct |
48 ms |
264 KB |
Correct |
6 |
Incorrect |
10 ms |
264 KB |
Not correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
13 ms |
260 KB |
Correct |
4 |
Correct |
55 ms |
284 KB |
Correct |
5 |
Correct |
48 ms |
264 KB |
Correct |
6 |
Incorrect |
10 ms |
264 KB |
Not correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
14 ms |
272 KB |
Correct |
4 |
Correct |
59 ms |
284 KB |
Correct |
5 |
Correct |
51 ms |
384 KB |
Correct |
6 |
Incorrect |
12 ms |
252 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Correct |
2 |
Correct |
3 ms |
200 KB |
Correct |
3 |
Correct |
14 ms |
272 KB |
Correct |
4 |
Correct |
59 ms |
284 KB |
Correct |
5 |
Correct |
51 ms |
384 KB |
Correct |
6 |
Incorrect |
12 ms |
252 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |