/in/foo.cc:8:13: error: 'int index [21]' redeclared as different kind of symbol
int index[21],orders[401];
^
In file included from /usr/include/c++/6/cstring:42:0,
from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:48,
from /in/foo.cc:1:
/usr/include/string.h:477:1: note: previous declaration 'const char* index(const char*, int)'
index (const char *__s, int __c) __THROW
^~~~~
/in/foo.cc: In function 'bool check(int, int, int)':
/in/foo.cc:13:10: warning: unused variable 'flag' [-Wunused-variable]
bool flag=1;
^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:33:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
int id = ++index[orders[i]];
^