#include "choreography.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct dancer {
vector<int> v;
ll p[2], f[2];
int o, s;
dancer() {}
dancer(vector<int> P) : v(P), p{0, 0}, f{0, 1}, o(0), s(0) {}
} A, B;
void init(int N, vector<int> P) {
A = dancer(P);
vector<int> R(N);
for(int i=0;i<N;i++) R[P[i]] = i;
B = dancer(R);
return;
}
void move_right(int K) {
B.p[0] += K, B.p[1] += K;
if(K % 2) B.o = !B.o;
return;
}
void move_left(int K) {
B.p[0] -= K, B.p[1] -= K;
if(K % 2) B.o = !B.o;
return;
}
void swap_places() {
swap(A.f[0], A.f[1]);
A.s = !A.s;
B.p[B.o]++, B.p[!B.o]--;
B.o = !B.o;
return;
}
void move_around() {
swap(A, B);
return;
}
int get_position(int D){
int N = A.v.size();
// int b = (D & 1) ^ A.s;
// int d =
int u = D;
return (B.v[u] + B.p[u % 2]%N + N) % N;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
6460 KB |
Output is correct |
2 |
Correct |
65 ms |
6468 KB |
Output is correct |
3 |
Correct |
64 ms |
6488 KB |
Output is correct |
4 |
Correct |
64 ms |
6468 KB |
Output is correct |
5 |
Correct |
42 ms |
4680 KB |
Output is correct |
6 |
Correct |
42 ms |
4924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
6th lines differ - on the 1st token, expected: '386', found: '110' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
59 ms |
6480 KB |
Output is correct |
2 |
Correct |
57 ms |
6460 KB |
Output is correct |
3 |
Correct |
63 ms |
6716 KB |
Output is correct |
4 |
Correct |
36 ms |
4928 KB |
Output is correct |
5 |
Correct |
36 ms |
4944 KB |
Output is correct |
6 |
Correct |
35 ms |
4924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
59 ms |
6480 KB |
Output is correct |
2 |
Correct |
57 ms |
6460 KB |
Output is correct |
3 |
Correct |
63 ms |
6716 KB |
Output is correct |
4 |
Correct |
36 ms |
4928 KB |
Output is correct |
5 |
Correct |
36 ms |
4944 KB |
Output is correct |
6 |
Correct |
35 ms |
4924 KB |
Output is correct |
7 |
Incorrect |
60 ms |
6492 KB |
3rd lines differ - on the 1st token, expected: '74726', found: '64494' |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
6460 KB |
Output is correct |
2 |
Correct |
65 ms |
6468 KB |
Output is correct |
3 |
Correct |
64 ms |
6488 KB |
Output is correct |
4 |
Correct |
64 ms |
6468 KB |
Output is correct |
5 |
Correct |
42 ms |
4680 KB |
Output is correct |
6 |
Correct |
42 ms |
4924 KB |
Output is correct |
7 |
Correct |
59 ms |
6480 KB |
Output is correct |
8 |
Correct |
57 ms |
6460 KB |
Output is correct |
9 |
Correct |
63 ms |
6716 KB |
Output is correct |
10 |
Correct |
36 ms |
4928 KB |
Output is correct |
11 |
Correct |
36 ms |
4944 KB |
Output is correct |
12 |
Correct |
35 ms |
4924 KB |
Output is correct |
13 |
Incorrect |
62 ms |
6468 KB |
11th lines differ - on the 1st token, expected: '36243', found: '41556' |
14 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
63 ms |
6460 KB |
Output is correct |
2 |
Correct |
65 ms |
6468 KB |
Output is correct |
3 |
Correct |
64 ms |
6488 KB |
Output is correct |
4 |
Correct |
64 ms |
6468 KB |
Output is correct |
5 |
Correct |
42 ms |
4680 KB |
Output is correct |
6 |
Correct |
42 ms |
4924 KB |
Output is correct |
7 |
Incorrect |
1 ms |
348 KB |
6th lines differ - on the 1st token, expected: '386', found: '110' |
8 |
Halted |
0 ms |
0 KB |
- |