Submission #569315

#TimeUsernameProblemLanguageResultExecution timeMemory
569315gavgavRoad Closures (APIO21_roads)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
#define vec vector
#define ll long long
vec<ll>minimum_closure_costs(int n,vec<ll> u,vec<ll> v,vec<ll> w){
    vec<ll> ws(n, 0);
    ll sum=0;
    for(ll i=1;i<n;ws[i]=w[i-1],sum+=w[i-1],++i);
    sort(ws.begin()++,ws.end(),greater<ll>());
    ll ans[n]{sum};
    for(ll i=1;i<n;++i){
        ans[i]=ans[i-1]-w[i-1];
    }
    return ws;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccqhFXlk.o: in function `main':
grader.cpp:(.text.startup+0x277): undefined reference to `minimum_closure_costs(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