This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// correct/solution-subtask1.cpp
#include "choreography.h"
#include <vector>
int n, s = 0;
std::vector<int> p;
void init(int N, std::vector<int> P){
n = N;
p.resize(N);
for(int i = 0; i < N; i++){
p[P[i]] = i;
}
}
void move_right(int K){
s = (s + K + n) % n;
}
void move_left(int K){
move_right(-K);
}
void swap_places() {}
void move_around() {}
int get_position(int D){
return (p[D] + s) % n;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |