Submission #122389

#TimeUsernameProblemLanguageResultExecution timeMemory
122389SirCenessWiring (IOI17_wiring)C++14
13 / 100
31 ms3832 KiB
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;

int n, m;

ll min_total_length(vector<int> r, vector<int> b) {
	n = r.size();
	m = b.size();
	int i = n-1;
	int j = 0;
	ll ans = 0;
	while (i >= 0 && j < m){
		ans += (ll)b[j]-(ll)r[i];
		i--;
		j++;
	}
	while (i >= 0){
		ans += (ll)b[0]-(ll)r[i];
		i--;
	}
	while (j < m){
		ans += (ll)b[j]-(ll)r[n-1];
		j++;
	}
	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...