# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
840371 | heavylightdecomp | Choreography (IOI23_choreography) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
int orz[maxn], delt[maxn], N, ch;
void init(int n, int[] p) {
N = n;
for(int i = 0; i < N; i++) {
orz[p[i]] = i;
}
for(int i = 0; i < N; i++) delt[i] = i;
}
void move_right(int K) {
ch += K;
}
void move_left(int K) {
ch += -K;
}
void swap_places() {
}
void move_around() {
}
int get_position(int D) {
int pos = delt[orz[D]] + ch;
while(pos >= n) {
pos -= n;
}
while(pos < 0) {
pos += n;
}
return pos;
}