# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
842623 | WLZ | Choreography (IOI23_choreography) | C++17 | 97 ms | 9300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |