Submission #570122

#TimeUsernameProblemLanguageResultExecution timeMemory
570122Garguy22Road Closures (APIO21_roads)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include <vector> #include <algorithm> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; #define pb push_back vl minimum_closure_costs(int N, vi U, vi V, vi W){ ll temp = 0; vi ans; sort(W.begin(), W.end()); ans.pb(0); for(int i = 0; i < N; i++){ temp += w[i]; ans.pb(temp); } reverse(ans.begin(), ans.end()); return ans; }

Compilation message (stderr)

roads.cpp: In function 'vl minimum_closure_costs(int, vi, vi, vi)':
roads.cpp:17:11: error: 'w' was not declared in this scope
   17 |   temp += w[i];
      |           ^
roads.cpp:21:9: error: could not convert 'ans' from 'vector<int>' to 'vector<long long int>'
   21 |  return ans;
      |         ^~~
      |         |
      |         vector<int>