제출 #570122

#제출 시각아이디문제언어결과실행 시간메모리
570122Garguy22도로 폐쇄 (APIO21_roads)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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>