Submission #825201

#TimeUsernameProblemLanguageResultExecution timeMemory
825201t6twotwoRoad Closures (APIO21_roads)C++17
Compilation error
0 ms0 KiB
#include "roads.h" #include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> minimum_closure_costs(int N, vector<int> U, vector<int> V, vector<int> W) { vector<ll> ans(N); if (U == vector(N, 0)) { sort(W.begin(), W.end()); for (int i = 0; i < N - 1; i++) { ans[N - 2 - i] = ans[N - 1 - i] + W[i]: } return ans; } ll dp0 = 0, dp1 = 0; for (int i = 0; i < N - 1; i++) { auto t = dp0; dp0 = min(dp0, dp1) + W[i]; dp1 = t; } ans[0] = accumulate(W.begin(), W.end(), 0LL); ans[1] = min(dp0, dp1); return ans; }

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:10:51: error: expected ';' before ':' token
   10 |             ans[N - 2 - i] = ans[N - 1 - i] + W[i]:
      |                                                   ^
      |                                                   ;