# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
923225 | AdamGS | Choreography (IOI23_choreography) | C++17 | 73 ms | 6432 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 "choreography.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=1e5+7;
int P[LIM], Q[LIM], n, a, b, inv;
vector<int>A, B;
void init(int N, vector<int>_P) {
n=N;
rep(i, n) P[i]=_P[i];
rep(i, n) Q[P[i]]=i;
}
void move_right(int k) {
if(!inv) a=(a+k)%n;
else b=(b+k)%n;
}
void move_left(int k) {
move_right((n-k)%n);
}
void swap_places() {
if(!inv) {
if(A.size() && A.back()==a%2) A.pop_back();
else A.pb(a%2);
} else {
if(B.size() && B.back()==b%2) B.pop_back();
else B.pb(b%2);
# | 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... |