Submission #574605

#TimeUsernameProblemLanguageResultExecution timeMemory
574605definitelynotmeeWiring (IOI17_wiring)C++98
0 / 100
1 ms212 KiB
#include<bits/stdc++.h>
#include"wiring.h"
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;


long long min_total_length(std::vector<int> r, std::vector<int> b) {
    int n = r.size(), m = b.size();
    ll resp = 0;
    for(int i = 0; i < n; i++)
        resp-=r[i];
    for(int i = 0; i < n; i++)
        resp+=b[i];
    while(n > m){
        resp+=b[0];
        n--;
    }
    while(m > n){
        resp-=r.back();
        m--;
    }
	return resp;
}
#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...