#include "swaps.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int N, int V) {
srand(time(NULL));
vector<int> x(N);
for(int i = 0; i < N; i++) x[i] = i + 1;
vector<int> shuff(N);
for(int i = 0; i < N; i++) {
shuff[i] = i+1;
}
for(int i = 0; i < N; i++) {
for(int j = i%2; j < N - 1; j += 2) {
schedule(x[j], x[j+1]);
}
vector<int> v = visit();
for(int j = i%2; j < N - 1; j += 2) {
if(v[j/2] == 0) swap(x[j], x[j+1]);
}
}
answer(x);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
14 ms |
208 KB |
Correct |
4 |
Correct |
40 ms |
304 KB |
Correct |
5 |
Correct |
50 ms |
304 KB |
Correct |
6 |
Correct |
57 ms |
372 KB |
Correct |
7 |
Correct |
41 ms |
304 KB |
Correct |
8 |
Correct |
44 ms |
304 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
5 ms |
208 KB |
Correct |
3 |
Correct |
17 ms |
208 KB |
Correct |
4 |
Correct |
40 ms |
296 KB |
Correct |
5 |
Correct |
48 ms |
416 KB |
Correct |
6 |
Correct |
41 ms |
300 KB |
Correct |
7 |
Correct |
56 ms |
376 KB |
Correct |
8 |
Correct |
40 ms |
300 KB |
Correct |
9 |
Correct |
40 ms |
304 KB |
Correct |
10 |
Correct |
53 ms |
300 KB |
Correct |
11 |
Correct |
44 ms |
388 KB |
Correct |
12 |
Correct |
47 ms |
304 KB |
Correct |
13 |
Correct |
41 ms |
428 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
2 ms |
208 KB |
Correct |
3 |
Correct |
0 ms |
208 KB |
Correct |
4 |
Correct |
3 ms |
208 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
13 ms |
208 KB |
Correct |
4 |
Correct |
48 ms |
404 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
13 ms |
208 KB |
Correct |
4 |
Correct |
48 ms |
404 KB |
Correct |
5 |
Correct |
1 ms |
208 KB |
Correct |
6 |
Correct |
3 ms |
208 KB |
Correct |
7 |
Correct |
11 ms |
208 KB |
Correct |
8 |
Correct |
52 ms |
332 KB |
Correct |
9 |
Correct |
47 ms |
304 KB |
Correct |
10 |
Correct |
52 ms |
308 KB |
Correct |
11 |
Correct |
45 ms |
300 KB |
Correct |
12 |
Correct |
42 ms |
304 KB |
Correct |
13 |
Correct |
1 ms |
256 KB |
Correct |
14 |
Correct |
5 ms |
208 KB |
Correct |
15 |
Correct |
14 ms |
208 KB |
Correct |
16 |
Correct |
42 ms |
352 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
4 ms |
208 KB |
Correct |
3 |
Correct |
18 ms |
208 KB |
Correct |
4 |
Correct |
54 ms |
364 KB |
Correct |
5 |
Correct |
41 ms |
332 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct |
2 |
Correct |
4 ms |
208 KB |
Correct |
3 |
Correct |
18 ms |
208 KB |
Correct |
4 |
Correct |
54 ms |
364 KB |
Correct |
5 |
Correct |
41 ms |
332 KB |
Correct |
6 |
Correct |
1 ms |
208 KB |
Correct |
7 |
Correct |
3 ms |
208 KB |
Correct |
8 |
Correct |
12 ms |
208 KB |
Correct |
9 |
Correct |
43 ms |
304 KB |
Correct |
10 |
Correct |
49 ms |
316 KB |
Correct |
11 |
Correct |
40 ms |
308 KB |
Correct |
12 |
Correct |
42 ms |
432 KB |
Correct |
13 |
Correct |
46 ms |
300 KB |
Correct |
14 |
Correct |
56 ms |
376 KB |
Correct |
15 |
Correct |
55 ms |
300 KB |
Correct |
16 |
Correct |
44 ms |
352 KB |
Correct |
17 |
Correct |
38 ms |
380 KB |
Correct |
18 |
Correct |
51 ms |
304 KB |
Correct |
19 |
Correct |
1 ms |
208 KB |
Correct |
20 |
Correct |
4 ms |
208 KB |
Correct |
21 |
Correct |
13 ms |
208 KB |
Correct |
22 |
Correct |
40 ms |
304 KB |
Correct |
23 |
Correct |
45 ms |
288 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
17 ms |
208 KB |
Correct |
4 |
Correct |
51 ms |
304 KB |
Correct |
5 |
Correct |
38 ms |
340 KB |
Correct |
6 |
Runtime error |
8 ms |
348 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
3 ms |
208 KB |
Correct |
3 |
Correct |
17 ms |
208 KB |
Correct |
4 |
Correct |
51 ms |
304 KB |
Correct |
5 |
Correct |
38 ms |
340 KB |
Correct |
6 |
Runtime error |
8 ms |
348 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
4 ms |
208 KB |
Correct |
3 |
Correct |
16 ms |
208 KB |
Correct |
4 |
Correct |
45 ms |
360 KB |
Correct |
5 |
Correct |
44 ms |
452 KB |
Correct |
6 |
Runtime error |
9 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Correct |
2 |
Correct |
4 ms |
208 KB |
Correct |
3 |
Correct |
16 ms |
208 KB |
Correct |
4 |
Correct |
45 ms |
360 KB |
Correct |
5 |
Correct |
44 ms |
452 KB |
Correct |
6 |
Runtime error |
9 ms |
284 KB |
Execution killed with signal 13 |
7 |
Halted |
0 ms |
0 KB |
- |