Submission #569243

#TimeUsernameProblemLanguageResultExecution timeMemory
569243niloyrootRoad Closures (APIO21_roads)C++14
5 / 100
58 ms5672 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<ll>; using pl = pair<ll,ll>; #define pb push_back #define form(m,it) for(auto it=m.begin(); it!=m.end(); it++) #define forp(i,a,b) for(ll i=a; i<=b; i++) #define forn(i,a,b) for(ll i=a; i>=b; i--) #define newl '\n' #define ff first #define ss second const ll mod = 1000000007; vi minimum_closure_costs(int n, vector<int> U, vector<int> V, vector<int> W){ vi ans; ll sum=0; for(auto u:W){ sum+=u; } sort(W.rbegin(), W.rend()); for(auto u:W){ ans.push_back(sum); sum-=u; } ans.push_back(0); 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...