Submission #1367283

#TimeUsernameProblemLanguageResultExecution timeMemory
1367283psigurdNile (IOI24_nile)C++20
Compilation error
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;
}

Compilation message (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