Submission #822863

#TimeUsernameProblemLanguageResultExecution timeMemory
822863SupersonicWiring (IOI17_wiring)C++14
13 / 100
22 ms4648 KiB
#include "wiring.h" #include <bits/stdc++.h> using namespace std; long long min_total_length(std::vector<int> r, std::vector<int> b) { long long t=0; auto tr=r,tb=b; reverse(r.begin(),r.end());reverse(b.begin(),b.end()); while(!r.empty()&&!b.empty()){ int rr=r.back(),bb=b.back(); r.pop_back();b.pop_back(); t+=abs(rr-bb); } while(!r.empty()){ int rr=r.back();t+=abs(rr-tb[0]);r.pop_back(); } while(!b.empty()){ int bb=b.back();t+=abs(bb-tr.back());b.pop_back(); } return t; }
#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...