Submission #969274

#TimeUsernameProblemLanguageResultExecution timeMemory
969274mariaclaraWiring (IOI17_wiring)C++17
13 / 100
24 ms3932 KiB
#include "wiring.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pii;
const int INF = 1e9+10;
const ll LINF = 1e18+10;
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define mk make_pair
#define pb push_back
#define f first 
#define s second

ll min_total_length(vector<int> r, vector<int> b) {
	ll ans = 0;
    
    for(auto x : r) ans -= x;
    for(auto x : b) ans += x;

    if(sz(b) > sz(r)) ans -= (ll)(sz(b) - sz(r)) * r.back();
    else ans += (ll)(sz(r) - sz(b)) * b[0];

    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...