# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1241336 | lovrot | Wiring (IOI17_wiring) | C++20 | 0 ms | 0 KiB |
#include "wiring.h"
#include <algorithm>
#include <vector>
#include <cstdio>
#define PB push_back
using namespace std;
typedef long long ll;
const int N = 210;
ll long min_total_length(vector<int> r, vector<int> b) {
for(; r.size() < b.size(); r.push_back(r.back()));
for(; b.size() < r.size(); b.push_back(b.front()));
ll ans = 0;
for(int x : r) ans -= x;
for(int x : b) ans += x;
return ans;
}