#include "bits/stdc++.h"
#include "swaps.h"
using namespace std;
void solve(int N, int V) {
vector <int> ord(N);
iota(ord.begin() ,ord.end() ,1);
for(int t = 0; t < V; t++){
for(int i = t&1; i+1 < N; i += 2)
schedule(ord[i] ,ord[i+1]);
auto res = visit();
for(int j = 0 ,i = t&1; i+1 < N; i += 2 ,j++)
if(!res[j])
swap(ord[i] ,ord[i+1]);
}
answer(ord);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
68 ms |
200 KB |
Correct |
2 |
Correct |
157 ms |
200 KB |
Correct |
3 |
Correct |
302 ms |
272 KB |
Correct |
4 |
Correct |
530 ms |
516 KB |
Correct |
5 |
Correct |
563 ms |
400 KB |
Correct |
6 |
Correct |
553 ms |
396 KB |
Correct |
7 |
Correct |
575 ms |
400 KB |
Correct |
8 |
Correct |
559 ms |
464 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
64 ms |
200 KB |
Correct |
2 |
Correct |
154 ms |
200 KB |
Correct |
3 |
Correct |
281 ms |
272 KB |
Correct |
4 |
Correct |
563 ms |
484 KB |
Correct |
5 |
Correct |
570 ms |
404 KB |
Correct |
6 |
Correct |
599 ms |
604 KB |
Correct |
7 |
Correct |
565 ms |
416 KB |
Correct |
8 |
Correct |
567 ms |
388 KB |
Correct |
9 |
Correct |
111 ms |
296 KB |
Correct |
10 |
Correct |
105 ms |
296 KB |
Correct |
11 |
Correct |
105 ms |
396 KB |
Correct |
12 |
Correct |
102 ms |
276 KB |
Correct |
13 |
Correct |
116 ms |
380 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
151 ms |
200 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
151 ms |
200 KB |
Correct |
3 |
Correct |
65 ms |
200 KB |
Correct |
4 |
Correct |
154 ms |
284 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
75 ms |
200 KB |
Correct |
2 |
Correct |
162 ms |
200 KB |
Correct |
3 |
Correct |
320 ms |
268 KB |
Correct |
4 |
Correct |
543 ms |
404 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
75 ms |
200 KB |
Correct |
2 |
Correct |
162 ms |
200 KB |
Correct |
3 |
Correct |
320 ms |
268 KB |
Correct |
4 |
Correct |
543 ms |
404 KB |
Correct |
5 |
Correct |
62 ms |
200 KB |
Correct |
6 |
Correct |
150 ms |
200 KB |
Correct |
7 |
Correct |
324 ms |
268 KB |
Correct |
8 |
Correct |
579 ms |
520 KB |
Correct |
9 |
Correct |
615 ms |
392 KB |
Correct |
10 |
Correct |
530 ms |
464 KB |
Correct |
11 |
Correct |
594 ms |
480 KB |
Correct |
12 |
Correct |
564 ms |
472 KB |
Correct |
13 |
Correct |
43 ms |
200 KB |
Correct |
14 |
Correct |
149 ms |
200 KB |
Correct |
15 |
Correct |
312 ms |
268 KB |
Correct |
16 |
Correct |
576 ms |
368 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
150 ms |
200 KB |
Correct |
3 |
Correct |
274 ms |
272 KB |
Correct |
4 |
Correct |
560 ms |
504 KB |
Correct |
5 |
Correct |
55 ms |
280 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
150 ms |
200 KB |
Correct |
3 |
Correct |
274 ms |
272 KB |
Correct |
4 |
Correct |
560 ms |
504 KB |
Correct |
5 |
Correct |
55 ms |
280 KB |
Correct |
6 |
Correct |
52 ms |
200 KB |
Correct |
7 |
Correct |
133 ms |
200 KB |
Correct |
8 |
Correct |
353 ms |
272 KB |
Correct |
9 |
Correct |
565 ms |
396 KB |
Correct |
10 |
Correct |
576 ms |
400 KB |
Correct |
11 |
Correct |
587 ms |
468 KB |
Correct |
12 |
Correct |
574 ms |
468 KB |
Correct |
13 |
Correct |
576 ms |
432 KB |
Correct |
14 |
Correct |
104 ms |
352 KB |
Correct |
15 |
Correct |
113 ms |
300 KB |
Correct |
16 |
Correct |
100 ms |
408 KB |
Correct |
17 |
Correct |
137 ms |
292 KB |
Correct |
18 |
Correct |
102 ms |
396 KB |
Correct |
19 |
Correct |
71 ms |
200 KB |
Correct |
20 |
Correct |
180 ms |
200 KB |
Correct |
21 |
Correct |
307 ms |
272 KB |
Correct |
22 |
Correct |
588 ms |
416 KB |
Correct |
23 |
Correct |
58 ms |
376 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
200 KB |
Correct |
2 |
Correct |
136 ms |
200 KB |
Correct |
3 |
Correct |
316 ms |
276 KB |
Correct |
4 |
Correct |
542 ms |
460 KB |
Correct |
5 |
Correct |
55 ms |
272 KB |
Correct |
6 |
Incorrect |
11 ms |
276 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
200 KB |
Correct |
2 |
Correct |
136 ms |
200 KB |
Correct |
3 |
Correct |
316 ms |
276 KB |
Correct |
4 |
Correct |
542 ms |
460 KB |
Correct |
5 |
Correct |
55 ms |
272 KB |
Correct |
6 |
Incorrect |
11 ms |
276 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
328 KB |
Correct |
2 |
Correct |
164 ms |
200 KB |
Correct |
3 |
Correct |
274 ms |
272 KB |
Correct |
4 |
Correct |
550 ms |
400 KB |
Correct |
5 |
Correct |
52 ms |
284 KB |
Correct |
6 |
Incorrect |
14 ms |
276 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
328 KB |
Correct |
2 |
Correct |
164 ms |
200 KB |
Correct |
3 |
Correct |
274 ms |
272 KB |
Correct |
4 |
Correct |
550 ms |
400 KB |
Correct |
5 |
Correct |
52 ms |
284 KB |
Correct |
6 |
Incorrect |
14 ms |
276 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |