Submission #321229

#TimeUsernameProblemLanguageResultExecution timeMemory
32122912tqianWiring (IOI17_wiring)C++17
13 / 100
42 ms3940 KiB
#include "wiring.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define f1r(i, a, b) for (int (i) = (a); (i) < (b); ++i) #define f0r(i, a) f1r(i, 0, a) #define pb push_back #define eb emplace_back #define f first #define s second #define sz(x) (int) (x).size() #define all(v) (v).begin(), (v).end() long long min_total_length(std::vector<int> r, std::vector<int> b) { ll n = sz(r); ll m = sz(b); ll ans = 0; ll gap = b[0] - r.back(); ans += gap * max(n, m); for (int x : r) ans -= x; for (int x : b) ans += x; ans += n * r.back(); ans -= m * b[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...