wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:10:38: error: 'i' was not declared in this scope
10 | dp[0][j] = dp[0][j-1] + r[0]>b[i]? r[0]-b[i]:b[i]-r[0];
| ^
wiring.cpp:13:35: error: 'd' was not declared in this scope
13 | dp[i][j] = min(dp[i-1][j],d[[i][j-1],dp[i-1][j-1]) + abs(r[i]-b[i]);
| ^
wiring.cpp:13:36: error: two consecutive '[' shall only introduce an attribute before '[' token
13 | dp[i][j] = min(dp[i-1][j],d[[i][j-1],dp[i-1][j-1]) + abs(r[i]-b[i]);
| ^
wiring.cpp:13:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
13 | dp[i][j] = min(dp[i-1][j],d[[i][j-1],dp[i-1][j-1]) + abs(r[i]-b[i]);
| ^~~
| std::min
In file included from /usr/include/c++/10/vector:60,
from wiring.h:1,
from wiring.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: 'std::min' declared here
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
wiring.cpp:13:62: error: 'abs' was not declared in this scope
13 | dp[i][j] = min(dp[i-1][j],d[[i][j-1],dp[i-1][j-1]) + abs(r[i]-b[i]);
| ^~~
wiring.cpp:12:7: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
12 | for(int j=1; j<m; j++)
| ^~~
wiring.cpp:14:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
14 | return d[n-1][m-1];
| ^~~~~~
wiring.cpp:14:9: error: 'd' was not declared in this scope; did you mean 'dp'?
14 | return d[n-1][m-1];
| ^
| dp