Submission #626966

#TimeUsernameProblemLanguageResultExecution timeMemory
626966GloryRoad Closures (APIO21_roads)C++17
0 / 100
35 ms3248 KiB
#include<bits/stdc++.h> #define vi vector<int> #define vll vector<long long> using namespace std; vll minimum_closure_costs(int N,vi U,vi V,vi W){ vll ans(N+100,0); long long res = 0; for(auto it: W) res+= it; sort(W.begin(),W.end(),greater<int>()); ans[0]=res; for(int i=1; i< N; i++){ res-=W[i-1]; ans[i]=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...