#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(i,i+1);
vector<int>vec=visit();
int it=0;
for(int i=1+flag;i<n;i+=2) if(!vec[it++]) swap(ans[i],ans[i+1]);
flag=!flag;
}
answer(ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
45 ms |
200 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
65 ms |
200 KB |
Not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
139 ms |
200 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
67 ms |
200 KB |
Correct |
2 |
Correct |
139 ms |
200 KB |
Correct |
3 |
Incorrect |
70 ms |
200 KB |
Not correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
66 ms |
200 KB |
Correct |
2 |
Correct |
133 ms |
200 KB |
Correct |
3 |
Correct |
288 ms |
320 KB |
Correct |
4 |
Correct |
543 ms |
300 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
66 ms |
200 KB |
Correct |
2 |
Correct |
133 ms |
200 KB |
Correct |
3 |
Correct |
288 ms |
320 KB |
Correct |
4 |
Correct |
543 ms |
300 KB |
Correct |
5 |
Incorrect |
54 ms |
200 KB |
Not correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
200 KB |
Correct |
2 |
Correct |
123 ms |
200 KB |
Correct |
3 |
Correct |
281 ms |
268 KB |
Correct |
4 |
Correct |
518 ms |
588 KB |
Correct |
5 |
Correct |
61 ms |
280 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
65 ms |
200 KB |
Correct |
2 |
Correct |
123 ms |
200 KB |
Correct |
3 |
Correct |
281 ms |
268 KB |
Correct |
4 |
Correct |
518 ms |
588 KB |
Correct |
5 |
Correct |
61 ms |
280 KB |
Correct |
6 |
Incorrect |
53 ms |
200 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
156 ms |
200 KB |
Correct |
3 |
Correct |
275 ms |
284 KB |
Correct |
4 |
Correct |
515 ms |
508 KB |
Correct |
5 |
Correct |
51 ms |
356 KB |
Correct |
6 |
Incorrect |
13 ms |
280 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
200 KB |
Correct |
2 |
Correct |
156 ms |
200 KB |
Correct |
3 |
Correct |
275 ms |
284 KB |
Correct |
4 |
Correct |
515 ms |
508 KB |
Correct |
5 |
Correct |
51 ms |
356 KB |
Correct |
6 |
Incorrect |
13 ms |
280 KB |
Not correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
49 ms |
200 KB |
Correct |
2 |
Correct |
137 ms |
200 KB |
Correct |
3 |
Correct |
272 ms |
268 KB |
Correct |
4 |
Correct |
544 ms |
456 KB |
Correct |
5 |
Correct |
51 ms |
296 KB |
Correct |
6 |
Incorrect |
12 ms |
396 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
49 ms |
200 KB |
Correct |
2 |
Correct |
137 ms |
200 KB |
Correct |
3 |
Correct |
272 ms |
268 KB |
Correct |
4 |
Correct |
544 ms |
456 KB |
Correct |
5 |
Correct |
51 ms |
296 KB |
Correct |
6 |
Incorrect |
12 ms |
396 KB |
Not correct |
7 |
Halted |
0 ms |
0 KB |
- |