Submission #208817

#TimeUsernameProblemLanguageResultExecution timeMemory
208817TAISA_Wiring (IOI17_wiring)C++14
13 / 100
47 ms1924 KiB
#include "wiring.h" #include <bits/stdc++.h> #define all(v) v.begin(),v.end() using namespace std; using ll=long long; long long min_total_length(std::vector<int> r, std::vector<int> b) { int n=r.size(),m=b.size(); if(r.back()<b[0]){ reverse(all(b)); ll res=0; if(n<=m){ for(int i=0;i<n;i++){ res+=b[i]-r[i]; } for(int i=n;i<m;i++){ res+=b[i]-r.back(); } }else{ for(int i=0;i<m;i++){ res+=b[i]-r[i]; } for(int i=m;i<n;i++){ res+=b.back()-r[i]; } } return res; } 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...