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/sol_na_st2.cpp
#include "choreography.h"
#include <vector>
#include <iostream>
#include <cassert>
#include <algorithm>
std::vector<int> p;
void init(int N, std::vector<int> P) {
p=P;
}
void move_right(int K) {
move_left((int)p.size()-K);
}
void move_left(int K) {
rotate(p.begin(), p.begin()+K, p.end());
}
void swap_places() {
for(int i=0;i<(int)p.size()/2;++i) {
std::swap(p[2*i], p[2*i+1]);
}
}
void move_around() {
std::vector<int> pos(p.size());
for(int i=0;i<(int)p.size();++i) {
pos[p[i]]=i;
}
p=pos;
}
int get_position(int D){
return find(p.begin(), p.end(), D)-p.begin();
}
# | 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... |