제출 #208816

#제출 시각아이디문제언어결과실행 시간메모리
208816TAISA_전선 연결 (IOI17_wiring)C++14
0 / 100
5 ms376 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[0]-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...