Submission #1178061

#TimeUsernameProblemLanguageResultExecution timeMemory
1178061KasymKRoad Closures (APIO21_roads)C++17
5 / 100
30 ms3888 KiB
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define pli pair<ll, int> #define pll pair<ll, ll> #define tr(i, c) for(auto i = c.begin(); i != c.end(); ++i) #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} vector<ll> minimum_closure_costs(int n, vector<int> u, vector<int> v, vector<int> w){ ll sm=accumulate(all(w), 0ll); sort(all(w)); vector<ll> ret; for(int i = 0; i < n; ++i){ ret.pb(sm); sm-=w[n-i-2]; } return ret; } // int main(){ // int n; // scanf("%d", &n); // vector<int> u, v, w; // for(int i = 1; i < n; ++i){ // int a, b, c; // scanf("%d%d%d", &a, &b, &c); // u.pb(a), v.pb(b), w.pb(c); // } // vector<ll> A=minimum_closure_costs(n, u, v, w); // tr(it, A) // printf("%lld ", *it); // return 0; // }
#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...