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-subtask4.cpp
#include "choreography.h"
#include <vector>
int x = 0, j = 0, n;
bool s = false;
std::vector<int> p, inv;
void init(int N, std::vector<int> P){
n = N;
p = P;
inv.resize(N);
for(int i = 0; i < N; i++){
inv[P[i]] = i;
}
}
void move_right(int K) {}
void move_left(int K) {}
void swap_places() {
x ^= 1;
}
void move_around(){
s = !s;
std::swap(x, j);
}
int get_position(int D){
return s ? p[D^j]^x : inv[D^j]^x;
}
# | 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... |