#include "choreography.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> pos[2];
vector<int> perm;
vector<int>pom;
int shift;
int n,i;
void init(int N, std::vector<int> P) {
n=N;
pos[0].resize(n);
pos[1].resize(n);
pom.resize(n);
for(int i=0;i<N;i++)pos[0][P[i]] = i;
perm = P;
for(i=0;i<n;i++)
pom[perm[perm[i]]] = perm[i];
perm = pom;
for(i=0;i<n;i++)
pos[1][perm[i]]=i;
i=0;
return;
}
int shift1, shift2;
void move_right(int k) {
shift1 = (shift1+k)%n;
return;
}
void move_left(int k) {
shift1 = (shift1-k+n)%n;
return;
}
void swap_places() {
return;
}
void move_around() {
i^=1;
swap(shift1,shift2);
shift1 = (n-shift1)%n;
shift2 = (n-shift2)%n;
return;
}
int get_position(int D){
return (pos[i][(D+shift2)%n]+shift1)%n;
// return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
9672 KB |
Output is correct |
2 |
Correct |
58 ms |
9924 KB |
Output is correct |
3 |
Correct |
58 ms |
9920 KB |
Output is correct |
4 |
Correct |
60 ms |
9924 KB |
Output is correct |
5 |
Correct |
37 ms |
7368 KB |
Output is correct |
6 |
Correct |
36 ms |
7372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
5th lines differ - on the 1st token, expected: '411', found: '410' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
9256 KB |
Output is correct |
2 |
Correct |
48 ms |
9472 KB |
Output is correct |
3 |
Correct |
55 ms |
9420 KB |
Output is correct |
4 |
Correct |
30 ms |
6944 KB |
Output is correct |
5 |
Correct |
30 ms |
6976 KB |
Output is correct |
6 |
Correct |
31 ms |
6856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
57 ms |
9256 KB |
Output is correct |
2 |
Correct |
48 ms |
9472 KB |
Output is correct |
3 |
Correct |
55 ms |
9420 KB |
Output is correct |
4 |
Correct |
30 ms |
6944 KB |
Output is correct |
5 |
Correct |
30 ms |
6976 KB |
Output is correct |
6 |
Correct |
31 ms |
6856 KB |
Output is correct |
7 |
Incorrect |
51 ms |
9412 KB |
3rd lines differ - on the 1st token, expected: '74726', found: '64493' |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
9672 KB |
Output is correct |
2 |
Correct |
58 ms |
9924 KB |
Output is correct |
3 |
Correct |
58 ms |
9920 KB |
Output is correct |
4 |
Correct |
60 ms |
9924 KB |
Output is correct |
5 |
Correct |
37 ms |
7368 KB |
Output is correct |
6 |
Correct |
36 ms |
7372 KB |
Output is correct |
7 |
Correct |
57 ms |
9256 KB |
Output is correct |
8 |
Correct |
48 ms |
9472 KB |
Output is correct |
9 |
Correct |
55 ms |
9420 KB |
Output is correct |
10 |
Correct |
30 ms |
6944 KB |
Output is correct |
11 |
Correct |
30 ms |
6976 KB |
Output is correct |
12 |
Correct |
31 ms |
6856 KB |
Output is correct |
13 |
Correct |
54 ms |
9928 KB |
Output is correct |
14 |
Correct |
55 ms |
9668 KB |
Output is correct |
15 |
Correct |
54 ms |
9668 KB |
Output is correct |
16 |
Correct |
39 ms |
7368 KB |
Output is correct |
17 |
Correct |
35 ms |
7276 KB |
Output is correct |
18 |
Correct |
34 ms |
7380 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
9672 KB |
Output is correct |
2 |
Correct |
58 ms |
9924 KB |
Output is correct |
3 |
Correct |
58 ms |
9920 KB |
Output is correct |
4 |
Correct |
60 ms |
9924 KB |
Output is correct |
5 |
Correct |
37 ms |
7368 KB |
Output is correct |
6 |
Correct |
36 ms |
7372 KB |
Output is correct |
7 |
Incorrect |
1 ms |
348 KB |
5th lines differ - on the 1st token, expected: '411', found: '410' |
8 |
Halted |
0 ms |
0 KB |
- |