Submission #626960

#TimeUsernameProblemLanguageResultExecution timeMemory
626960GloryRoad Closures (APIO21_roads)C++17
Compilation error
0 ms0 KiB
#include<iostream> #define int long long using namespace std; int64_t[] minimum_closure_costs(int N, int[] U, int[] V, int[] W){ int ans[N+5]; int res = 0; for(int i=1; i<=N; i++){ res+= W[i]; } sort(W+1,W+1+N,greater<int>()); ans[0]=res; for(int i=1; i<=N; i++){ res-=W[i-1]; ans[i]=res; } return ans; }

Compilation message (stderr)

roads.cpp:5:8: error: structured binding declaration cannot have type 'int64_t' {aka 'long int'}
    5 | int64_t[] minimum_closure_costs(int N, int[] U, int[] V, int[] W){
      |        ^~
roads.cpp:5:8: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
roads.cpp:5:8: error: empty structured binding declaration
roads.cpp:5:11: error: expected initializer before 'minimum_closure_costs'
    5 | int64_t[] minimum_closure_costs(int N, int[] U, int[] V, int[] W){
      |           ^~~~~~~~~~~~~~~~~~~~~