제출 #1367283

#제출 시각아이디문제언어결과실행 시간메모리
1367283psigurd나일강 (IOI24_nile)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

vector<ll> calculate_costs(vector<ll> w, vector<ll> a, vector<ll> b, vector<ll> e){
    vector<ll> ans;
    int n = w.size();
    ll SUM = 0;
    for (auto &p : b){
        SUM += p;
    }

    if (n % 2 == 1){
        ll MIN = 1000000000000000000;
        for (int i = 0; i < n; i++){
            MIN = min(MIN, a[i] - b[i]);
        }
        SUM += MIN;
    }

    for (int i = 0; i < n; i++){
        ans.push_back(SUM);
    }
    return ans;
}

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

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