Submission #93682

#TimeUsernameProblemLanguageResultExecution timeMemory
93682someone_aaWiring (IOI17_wiring)C++17
13 / 100
31 ms3836 KiB
#include <bits/stdc++.h> #include "wiring.h" #define ll long long using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { int max_r = INT_MIN, min_r = INT_MAX; int max_b = INT_MIN, min_b = INT_MAX; for(int i:r) { if(i > max_r) max_r = i; if(i < min_r) min_r = i; } for(int i:b) { if(i > max_b) max_b = i; if(i < min_b) min_b = i; } ll sum = (1LL * min_b - 1LL * max_r) * 1LL * max(r.size(), b.size()); for(int i:r) { sum += 1LL * (max_r - i); } for(int i:b) { sum += 1LL * (i - min_b); } return sum; }
#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...