제출 #1340080

#제출 시각아이디문제언어결과실행 시간메모리
1340080yc11자리 배치 (IOI18_seats)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include "seats.h"
#define int long long
using namespace std;

int w;
vector<int> c;
void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C) {
    c = C;
    w = W;
}

int swap_seats(int a, int b) {
    swap(c[a],c[b]);
  int l = c[0];
    int r = c[0];
    int ans = 0;
    for (int i = 0;i<w;i++){


        if (c[i]>r) r = c[i];
        if (c[i]<l) l = c[i];

        if (r-l==i) ans++;
    }
    return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

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