Submission #437698

#TimeUsernameProblemLanguageResultExecution timeMemory
437698ala2Road Closures (APIO21_roads)C++14
Compilation error
0 ms0 KiB
#include "roads.h" #include <vector> #include<algorithm> using namespace std ; vector<long long>v; vector<long long> minimum_closure_costs(int N, vector<int> U,vector<int> V,vector<int> W) { sort(W.begin(),W.end()); v.push_back(W[0]); for(int i=1;i<n;i++) v.push_back(v[0]+W[1]); v.pop_back(); return v;

Compilation message (stderr)

roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:11:28: error: 'n' was not declared in this scope
   11 |              for(int i=1;i<n;i++)
      |                            ^
roads.cpp:14:15: error: expected '}' at end of input
   14 |       return v;
      |               ^
roads.cpp:7:95: note: to match this '{'
    7 |     vector<long long> minimum_closure_costs(int N, vector<int> U,vector<int> V,vector<int> W) {
      |                                                                                               ^