Submission #1361673

#TimeUsernameProblemLanguageResultExecution timeMemory
1361673hgmhcWiring (IOI17_wiring)C++20
Compilation error
0 ms0 KiB
#include "wiring.h"
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define per(i,a,b) for(ll i=(b);i>=(a);--i)
#define siz(x) ((ll)(x).size())
#define all(x) (x).begin(), (x).end()
#define pb push_back
using namespace std; using ll = long long; using vi = vector<ll>; using ii = pair<ll,ll>;

ll min_total_length(vector<int> r, vector<int> b) {

	int n=siz(r);
	int m=siz(b);
	ll ans = 0;

	for(int i=0; i<n; ++i) {
		ans += b[0] - r[i];
	}
	for(int i=0; i<m; ++i) {
		ans += b[i] - b[0];
	}
	if (n < m) ans += 1ll * (m-n) * (b[0] - a[n-1]);

	return ans;
}

Compilation message (stderr)

wiring.cpp: In function 'll min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:22:49: error: 'a' was not declared in this scope
   22 |         if (n < m) ans += 1ll * (m-n) * (b[0] - a[n-1]);
      |                                                 ^