/in/foo.cc:6:51: error: 'int div [3003][3003]' redeclared as different kind of symbol
int n, Wmax, k, val[1003], w[3003], div[3003][3003], fl[3003];
^
In file included from /usr/include/c++/6/cstdlib:75:0,
from /usr/include/c++/6/ext/string_conversions.h:41,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /in/foo.cc:1:
/usr/include/stdlib.h:749:14: note: previous declaration 'div_t div(int, int)'
extern div_t div (int __numer, int __denom)
^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:31:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
div[cnt][++div[cnt][0]] = i;
^
/in/foo.cc:31:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
div[cnt][++div[cnt][0]] = i;
^
/in/foo.cc:34:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
div[fl[f[i]]][++div[cnt][0]] = i;
^
/in/foo.cc:34:27: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
div[fl[f[i]]][++div[cnt][0]] = i;
^
/in/foo.cc:39:25: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
for(int k=1; k<=div[i][0]; k++) {
^
/in/foo.cc:40:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
if(j >= w[div[i][k]])
^
/in/foo.cc:41:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
dp[j] = max(dp[j], dp[j-w[div[i][k]]]+val[div[i][k]]);
^
/in/foo.cc:41:53: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
dp[j] = max(dp[j], dp[j-w[div[i][k]]]+val[div[i][k]]);
^