ricehub.cpp: In function 'int besthub(int, int, int*, long long int)':
ricehub.cpp:8:2: error: 'vector' was not declared in this scope
vector<long long>diferencias;
^~~~~~
ricehub.cpp:8:2: note: suggested alternative:
In file included from /usr/include/c++/7/vector:64:0,
from /usr/include/c++/7/functional:61,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:71,
from ricehub.cpp:2:
/usr/include/c++/7/bits/stl_vector.h:216:11: note: 'std::vector'
class vector : protected _Vector_base<_Tp, _Alloc>
^~~~~~
ricehub.cpp:8:9: error: expected primary-expression before 'long'
vector<long long>diferencias;
^~~~
ricehub.cpp:13:19: error: request for member 'size' in 'X', which is of non-class type 'int*'
for(int j=0;j<X.size();j++){
^~~~
ricehub.cpp:14:8: warning: unused variable 'dif' [-Wunused-variable]
int dif=0;
^~~
ricehub.cpp:20:4: error: 'dif' was not declared in this scope
dif = abs(i-X[j]);
^~~
ricehub.cpp:20:4: note: suggested alternative: 'div'
dif = abs(i-X[j]);
^~~
div
ricehub.cpp:20:18: error: 'j' was not declared in this scope
dif = abs(i-X[j]);
^
ricehub.cpp:21:4: error: 'diferencias' was not declared in this scope
diferencias.push_back(dif);
^~~~~~~~~~~
ricehub.cpp:23:20: error: request for member 'size' in 'X', which is of non-class type 'int*'
for(int k=0;k<X.size();k++){
^~~~
ricehub.cpp:24:17: error: 'V' was not declared in this scope
if(suma_d + V[j] <= B){
^
ricehub.cpp:31:18: error: 'max' was not declared in this scope
int maximo = max(jamon, campos);
^~~
ricehub.cpp:31:18: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
from ricehub.cpp:2:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note: 'std::max'
max(initializer_list<_Tp> __l, _Compare __comp)
^~~