Submission #1116578

#TimeUsernameProblemLanguageResultExecution timeMemory
1116578PagodePaivaRoad Closures (APIO21_roads)C++17
0 / 100
28 ms5456 KiB
#include<bits/stdc++.h> #include "roads.h" #include <vector> using namespace std; std::vector<long long> minimum_closure_costs(int n, std::vector<int> U, std::vector<int> V, std::vector<int> W) { long long res = 0; vector <int> v; for(int i = 0;i < n-1;i++){ v.push_back(W[i]); } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); vector <long long> ans; ans.push_back(0); for(int k = n-2;k >= 0;k--){ res += v.back(); v.pop_back(); ans.push_back(res); } 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...