Submission #981819

#TimeUsernameProblemLanguageResultExecution timeMemory
981819UnforgettableplRoad Closures (APIO21_roads)C++17
5 / 100
60 ms5744 KiB
#include <bits/stdc++.h> using namespace std; #define int long long std::vector<int> minimum_closure_costs(int32_t N, std::vector<int32_t > U, std::vector<int32_t > V, std::vector<int32_t > W) { int base = 0; for(int i=0;i<N-1;i++)base+=W[i]; vector<int> ans = {base}; int curr = 0; sort(W.rbegin(), W.rend()); for(int i=0;i<N-1;i++){ curr+=W[i]; ans.emplace_back(base-curr); } 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...