제출 #253447

#제출 시각아이디문제언어결과실행 시간메모리
253447ErkhemkhuuArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
const ll N = 2005;
ll count_swaps(vector <int> &vc) {
    ll n, i, res, j, k;
    n = vc.size();
    res = 0;
    for(i = 0; i < n; i += 2) {
        for(j = i + 1; j < n; j++) {
            if(-vc[i] == vc[j]) {
                for(k = j; k >= i + 2; k--) {
                    swap(vc[k], vc[k - 1]);
                    res++;
                }
                break;
            }
        }
        res += (!(abs(vc[i]) == abs(vc[i + 1]) && vc[i] < vc[i + 1]));
    }
    return res;
}

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

/tmp/ccWZSfuQ.o: In function `main':
grader.cpp:(.text.startup+0x282): undefined reference to `count_swaps(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status