답안 #840378

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
840378 2023-08-31T10:24:56 Z heavylightdecomp Choreography (IOI23_choreography) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+5;
int orz[maxn], delt[maxn], N, ch;
void init(int n, int* p) {
    N = n;
    for(int i = 0; i < N; i++) {
        orz[p[i]] = i;
    }
    for(int i = 0; i < N; i++) delt[i] = i;
}
void move_right(int K) {
    ch += K;
}
void move_left(int K) {
    ch += -K;
}
void swap_places() {

}
void move_around() {

}
int get_position(int D) {
    int pos = delt[orz[D]] + ch;
    while(pos >= N) {
        pos -= N;
    }
    while(pos < 0) {
        pos += N;
    }
    return pos;
}

Compilation message

/usr/bin/ld: /tmp/ccawdzyh.o: in function `main':
grader.cpp:(.text.startup+0x40e): undefined reference to `init(int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status