#include "choreography.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=1e5+7;
int P[LIM], Q[LIM], n, a;
vector<int>A;
void init(int N, vector<int>_P) {
n=N;
rep(i, n) P[i]=_P[i];
rep(i, n) Q[P[i]]=i;
}
void move_right(int k) {
a=(a+k)%n;
}
void move_left(int k) {
move_right((n-k)%n);
}
void swap_places() {
if(A.size() && A.back()==a%2) A.pop_back();
else A.pb(a%2);
}
void move_around() {
}
int get_position(int d) {
int x=Q[d];
int p=A.size()%n;
if(A.size() && x%2==A[0]) x=(x+p)%n; else x=(x-p+n)%n;
return (x+a)%n;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
6340 KB |
Output is correct |
2 |
Correct |
61 ms |
6372 KB |
Output is correct |
3 |
Correct |
61 ms |
6340 KB |
Output is correct |
4 |
Correct |
61 ms |
6376 KB |
Output is correct |
5 |
Correct |
40 ms |
4552 KB |
Output is correct |
6 |
Correct |
41 ms |
4576 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
6th lines differ - on the 1st token, expected: '386', found: '108' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
56 ms |
6380 KB |
16th lines differ - on the 1st token, expected: '54117', found: '49341' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
56 ms |
6380 KB |
16th lines differ - on the 1st token, expected: '54117', found: '49341' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
6340 KB |
Output is correct |
2 |
Correct |
61 ms |
6372 KB |
Output is correct |
3 |
Correct |
61 ms |
6340 KB |
Output is correct |
4 |
Correct |
61 ms |
6376 KB |
Output is correct |
5 |
Correct |
40 ms |
4552 KB |
Output is correct |
6 |
Correct |
41 ms |
4576 KB |
Output is correct |
7 |
Incorrect |
56 ms |
6380 KB |
16th lines differ - on the 1st token, expected: '54117', found: '49341' |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
6340 KB |
Output is correct |
2 |
Correct |
61 ms |
6372 KB |
Output is correct |
3 |
Correct |
61 ms |
6340 KB |
Output is correct |
4 |
Correct |
61 ms |
6376 KB |
Output is correct |
5 |
Correct |
40 ms |
4552 KB |
Output is correct |
6 |
Correct |
41 ms |
4576 KB |
Output is correct |
7 |
Incorrect |
1 ms |
344 KB |
6th lines differ - on the 1st token, expected: '386', found: '108' |
8 |
Halted |
0 ms |
0 KB |
- |