# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
842623 | WLZ | Choreography (IOI23_choreography) | C++17 | 97 ms | 9300 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;
int n, cur;
vector< vector<int> > p, shift_p, add_p;
vector<int> add;
void init(int N, std::vector<int> P) {
n = N; cur = 0;
p = {P, vector<int>(n)};
add = {0, 0};
add_p = shift_p = {{0, 0}, {0, 0}};
for (int i = 0; i < n; i++) p[1][p[0][i]] = i;
return;
}
void move_right(int K) {
if (shift_p[cur][0] % 2 == 0) {
shift_p[cur][0] = (shift_p[cur][0] + K) % n;
shift_p[cur][1] = (shift_p[cur][1] + K) % n;
} else {
int a = shift_p[cur][0], b = shift_p[cur][1];
shift_p[cur][0] = (a + K) % n;
shift_p[cur][1] = (b + K) % n;
}
//shift[cur] = (shift[cur] + K) % n;
add[!cur] = (add[!cur] + K) % n;
return;
# | 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... |