Submission #1056087

#TimeUsernameProblemLanguageResultExecution timeMemory
1056087Halym2007Road Closures (APIO21_roads)C++17
0 / 100
20 ms4300 KiB
#include <bits/stdc++.h> #include "roads.h" using namespace std; #define ll long long #define sz size() #define ff first #define ss second #define pb push_back #define pii pair <ll, ll> const int N = 2e5 + 5; vector <pair <ll, pii>> v, q; vector <ll> jog, jogap; int deg[N]; vector<long long> minimum_closure_costs(int n, vector<int> l, vector<int> r, vector<int> w) { ll sum = 0, sum1 = 0, sum2 = 0; for (int i = 0; i < n - 1; ++i) { sum += w[i]; if (i % 2 == 0) sum1 += w[i]; else sum2 += w[i]; } jogap.pb(sum); jogap.pb (sum - max (sum1, sum2)); for (int i = 2; i < n; ++i) { jogap.pb(0); } return jogap; } //int main() { // freopen ("input.txt", "r", stdin); // int N; // assert(1 == scanf("%d", &N)); // // std::vector<int> U(N - 1), V(N - 1), W(N - 1); // for (int i = 0; i < N - 1; ++i) { // assert(3 == scanf("%d %d %d", &U[i], &V[i], &W[i])); // } // // std::vector<long long> closure_costs = minimum_closure_costs(N, U, V, W); // for (int i = 0; i < static_cast<int>(closure_costs.size()); ++i) { // if (i > 0) { // printf(" "); // } // printf("%lld",closure_costs[i]); // } // printf("\n"); // 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...