#include <bits/stdc++.h>
#include "swaps.h"
using namespace std;
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define ll long long
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;
void solve(int n,int v)
{
vector<int>ans(n);
for(int i=0;i<n;i++) ans[i]=i+1;
bool flag=0;
while(v--)
{
for(int i=1+flag;i<n;i+=2) schedule(ans[i-1],ans[i]);
vector<int>vec=visit();
int it=0;
for(int i=1+flag;i<n;i+=2) if(!vec[it++]) swap(ans[i-1],ans[i]);
flag=!flag;
}
answer(ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
64 ms |
200 KB |
Correct |
2 |
Correct |
121 ms |
200 KB |
Correct |
3 |
Correct |
301 ms |
268 KB |
Correct |
4 |
Correct |
567 ms |
408 KB |
Correct |
5 |
Correct |
530 ms |
456 KB |
Correct |
6 |
Correct |
512 ms |
508 KB |
Correct |
7 |
Correct |
590 ms |
396 KB |
Correct |
8 |
Correct |
543 ms |
452 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
200 KB |
Correct |
2 |
Correct |
137 ms |
200 KB |
Correct |
3 |
Correct |
304 ms |
276 KB |
Correct |
4 |
Correct |
574 ms |
296 KB |
Correct |
5 |
Correct |
539 ms |
468 KB |
Correct |
6 |
Correct |
687 ms |
404 KB |
Correct |
7 |
Correct |
549 ms |
396 KB |
Correct |
8 |
Correct |
543 ms |
400 KB |
Correct |
9 |
Correct |
108 ms |
380 KB |
Correct |
10 |
Correct |
107 ms |
300 KB |
Correct |
11 |
Correct |
110 ms |
428 KB |
Correct |
12 |
Correct |
105 ms |
384 KB |
Correct |
13 |
Correct |
113 ms |
296 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
200 KB |
Correct |
2 |
Correct |
142 ms |
200 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
200 KB |
Correct |
2 |
Correct |
142 ms |
200 KB |
Correct |
3 |
Correct |
54 ms |
200 KB |
Correct |
4 |
Correct |
154 ms |
200 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
149 ms |
200 KB |
Correct |
3 |
Correct |
293 ms |
272 KB |
Correct |
4 |
Correct |
553 ms |
392 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
149 ms |
200 KB |
Correct |
3 |
Correct |
293 ms |
272 KB |
Correct |
4 |
Correct |
553 ms |
392 KB |
Correct |
5 |
Correct |
54 ms |
200 KB |
Correct |
6 |
Correct |
162 ms |
200 KB |
Correct |
7 |
Correct |
317 ms |
272 KB |
Correct |
8 |
Correct |
551 ms |
516 KB |
Correct |
9 |
Correct |
537 ms |
468 KB |
Correct |
10 |
Correct |
553 ms |
552 KB |
Correct |
11 |
Correct |
586 ms |
464 KB |
Correct |
12 |
Correct |
557 ms |
344 KB |
Correct |
13 |
Correct |
66 ms |
200 KB |
Correct |
14 |
Correct |
165 ms |
200 KB |
Correct |
15 |
Correct |
300 ms |
272 KB |
Correct |
16 |
Correct |
594 ms |
380 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
158 ms |
200 KB |
Correct |
3 |
Correct |
290 ms |
272 KB |
Correct |
4 |
Correct |
553 ms |
564 KB |
Correct |
5 |
Correct |
57 ms |
328 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
158 ms |
200 KB |
Correct |
3 |
Correct |
290 ms |
272 KB |
Correct |
4 |
Correct |
553 ms |
564 KB |
Correct |
5 |
Correct |
57 ms |
328 KB |
Correct |
6 |
Correct |
67 ms |
200 KB |
Correct |
7 |
Correct |
147 ms |
200 KB |
Correct |
8 |
Correct |
298 ms |
276 KB |
Correct |
9 |
Correct |
576 ms |
544 KB |
Correct |
10 |
Correct |
569 ms |
420 KB |
Correct |
11 |
Correct |
541 ms |
548 KB |
Correct |
12 |
Correct |
543 ms |
396 KB |
Correct |
13 |
Correct |
563 ms |
356 KB |
Correct |
14 |
Correct |
114 ms |
396 KB |
Correct |
15 |
Correct |
136 ms |
296 KB |
Correct |
16 |
Correct |
108 ms |
364 KB |
Correct |
17 |
Correct |
131 ms |
352 KB |
Correct |
18 |
Correct |
113 ms |
380 KB |
Correct |
19 |
Correct |
55 ms |
200 KB |
Correct |
20 |
Correct |
161 ms |
200 KB |
Correct |
21 |
Correct |
300 ms |
276 KB |
Correct |
22 |
Correct |
543 ms |
452 KB |
Correct |
23 |
Correct |
59 ms |
300 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
155 ms |
200 KB |
Correct |
3 |
Correct |
304 ms |
272 KB |
Correct |
4 |
Correct |
563 ms |
440 KB |
Correct |
5 |
Correct |
54 ms |
292 KB |
Correct |
6 |
Incorrect |
11 ms |
272 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
155 ms |
200 KB |
Correct |
3 |
Correct |
304 ms |
272 KB |
Correct |
4 |
Correct |
563 ms |
440 KB |
Correct |
5 |
Correct |
54 ms |
292 KB |
Correct |
6 |
Incorrect |
11 ms |
272 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
200 KB |
Correct |
2 |
Correct |
149 ms |
200 KB |
Correct |
3 |
Correct |
293 ms |
276 KB |
Correct |
4 |
Correct |
534 ms |
392 KB |
Correct |
5 |
Correct |
60 ms |
296 KB |
Correct |
6 |
Incorrect |
14 ms |
272 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
200 KB |
Correct |
2 |
Correct |
149 ms |
200 KB |
Correct |
3 |
Correct |
293 ms |
276 KB |
Correct |
4 |
Correct |
534 ms |
392 KB |
Correct |
5 |
Correct |
60 ms |
296 KB |
Correct |
6 |
Incorrect |
14 ms |
272 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |