제출 #617930

#제출 시각아이디문제언어결과실행 시간메모리
617930MohamedAliSaidane도로 폐쇄 (APIO21_roads)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include "roads.h" using namespace __gnu_pbds; using namespace std; typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set; typedef long long ll; typedef long double ld; //#define int ll typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ld,ld> pld; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpi; typedef vector<pll> vpl; #define pb push_back #define popb pop_back #define pp pop_back #define pf push_front #define popf pop_front #define all(x) (x).begin(),(x).end() #define ff first #define ss second int nx[4] = {0,0,1,-1}, ny[4] = {1,-1,0,0}; ll gcd(ll a , ll b) {return b ? gcd(b , a % b) : a ;} ll lcm(ll a , ll b) {return (a * b) / gcd(a , b);} const ll MOD = 998244353; vll minimum_closure_costs(int N, vi U, vi V, vi W) { sort(all(W)); vll ans(n, 0); ll cursum = 0ll; for(int i = 1; i < n; i++) { cursum += W[i - 1]; ans[i] = cursum; } reverse(all(ans)); return ans; }

컴파일 시 표준 에러 (stderr) 메시지

roads.cpp: In function 'vll minimum_closure_costs(int, vi, vi, vi)':
roads.cpp:46:20: error: 'n' was not declared in this scope
   46 |            vll ans(n, 0);
      |                    ^