Submission #52754

#TimeUsernameProblemLanguageResultExecution timeMemory
52754KieranHorganWiring (IOI17_wiring)C++17
0 / 100
2 ms512 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; long long min_total_length(vector<int> r, vector<int> b) { int ans = 0; reverse(r.begin(), r.end()); while(r.size() > 2 && b.size() > 2) { ans += abs(r.back()-b.back()); r.pop_back(); b.pop_back(); } while(r.size() > 2) { ans += abs(r.back()-b.back()); r.pop_back(); } while(b.size() > 2) { ans += abs(r.back()-b.back()); b.pop_back(); } ans += abs(r.back()-b.back()); 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...