답안 #853787

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
853787 2023-09-25T08:42:30 Z JooDdae Choreography (IOI23_choreography) C++17
0 / 100
63 ms 6460 KB
#include "choreography.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

struct dancer {
    vector<int> v;
    ll p[2], f[2];
    int o, s;

    dancer() {}
    dancer(vector<int> P) : v(P), p{0, 0}, f{0, 1}, o(0), s(0) {}
} A, B;

void init(int N, vector<int> P) {
    A = dancer(P);
    vector<int> R(N);
    for(int i=0;i<N;i++) R[P[i]] = i;
    B = dancer(R);
    return;
} 

void move_right(int K) {

    B.p[0] += K, B.p[1] += K;
    if(K % 2) B.o = !B.o;

    return;
}

void move_left(int K) {


    B.p[0] -= K, B.p[1] -= K;
    if(K % 2) B.o = !B.o;

    return;
}

void swap_places() {
    swap(A.f[0], A.f[1]);
    A.s = !A.s;
    
    B.p[B.o]++, B.p[!B.o]--;
    B.o = !B.o;

    return;
}

void move_around() {
    swap(A, B);
    return;
}

int get_position(int D){
    int N = A.v.size();

    // int b = (D & 1) ^ A.s;
    // int d = 
    int u = D;

    return A.v[u];
}

Compilation message

choreography.cpp: In function 'int get_position(int)':
choreography.cpp:56:9: warning: unused variable 'N' [-Wunused-variable]
   56 |     int N = A.v.size();
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 6460 KB 3rd lines differ - on the 1st token, expected: '63867', found: '62345'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB 3rd lines differ - on the 1st token, expected: '111', found: '302'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 56 ms 6460 KB 3rd lines differ - on the 1st token, expected: '84714', found: '9233'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 56 ms 6460 KB 3rd lines differ - on the 1st token, expected: '84714', found: '9233'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 6460 KB 3rd lines differ - on the 1st token, expected: '63867', found: '62345'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 6460 KB 3rd lines differ - on the 1st token, expected: '63867', found: '62345'
2 Halted 0 ms 0 KB -