제출 #969596

#제출 시각아이디문제언어결과실행 시간메모리
969596europium도로 폐쇄 (APIO21_roads)C++17
5 / 100
50 ms5676 KiB
#include "roads.h" #include <vector> #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); ll cost = accumulate(W.begin(), W.end(), ll(0)); ans[0] = cost; sort(W.rbegin(), W.rend()); for (int i = 0; i < n - 1; i++) { cost -= W[i]; ans[i+1] = cost; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...