제출 #434236

#제출 시각아이디문제언어결과실행 시간메모리
434236Monchito전선 연결 (IOI17_wiring)C++14
13 / 100
36 ms1852 KiB
#include "wiring.h" #include <iostream> using namespace std; using ll = long long; ll min_total_length(vector<int> r, vector<int> b) { int p1 = 0, p2 = 0, n = (int)r.size(), m = (int)b.size(); ll ans=0; while(p1 < n || p2 < m) { ll x = (p1 < n)? r[p1] : r[n-1]; ll y = (p2 < m)? b[p2] : b[0]; ans += y - x; p1++; p2++; } 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...