Submission #737306

#TimeUsernameProblemLanguageResultExecution timeMemory
737306keisuke6Road Closures (APIO21_roads)C++14
Compilation error
0 ms0 KiB
#include "roads.h" #include <vector> #include <algorithm> using namespace std; #define ll long long; std::vector<ll> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) { vector<ll> A = {}; ll a = 0; for(int i=0;i<W.size();i++) a += W[i]; A.push_back(a); a = 0; ll b = 0; for(int i=0;i<W.size();i++){ if(i%2) a += W[i]; else b += W[i]; } A.push_back(min(a,b)); while(A.size() != N) A.push_back(0); return A; }

Compilation message (stderr)

roads.cpp:6:17: error: template argument 1 is invalid
    6 | #define ll long long;
      |                 ^~~~
roads.cpp:7:13: note: in expansion of macro 'll'
    7 | std::vector<ll> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
      |             ^~
roads.cpp:6:17: error: template argument 2 is invalid
    6 | #define ll long long;
      |                 ^~~~
roads.cpp:7:13: note: in expansion of macro 'll'
    7 | std::vector<ll> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
      |             ^~
roads.cpp:7:15: error: expected unqualified-id before '>' token
    7 | std::vector<ll> minimum_closure_costs(int N, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
      |               ^