# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1241336 | lovrot | 전선 연결 (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;
}