제출 #52754

#제출 시각아이디문제언어결과실행 시간메모리
52754KieranHorgan전선 연결 (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...