Main.cpp:31:19: error: 'int close [1000001]' redeclared as different kind of entity
31 | int close[1000'001];
| ^
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
from /usr/include/signal.h:328,
from /usr/include/c++/11/csignal:42,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:43,
from Main.cpp:1:
/usr/include/unistd.h:358:12: note: previous declaration 'int close(int)'
358 | extern int close (int __fd);
| ^~~~~
Main.cpp: In function 'dp calc(int, int, int)':
Main.cpp:51:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
51 | dps.pb(calc(i+4,close[i+3]-1,1));
| ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
Main.cpp:51:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
51 | dps.pb(calc(i+4,close[i+3]-1,1));
| ~~~~~~~~~~^~
Main.cpp:51:43: error: invalid conversion from 'int (*)(int)' to 'int' [-fpermissive]
51 | dps.pb(calc(i+4,close[i+3]-1,1));
| ~~~~~~~~~~^~
| |
| int (*)(int)
Main.cpp:34:20: note: initializing argument 2 of 'dp calc(int, int, int)'
34 | dp calc(int l, int r, int type)
| ~~~~^
Main.cpp:55:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
55 | dps.pb(calc(i+4,close[i+3]-1,0));
| ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
Main.cpp:55:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
55 | dps.pb(calc(i+4,close[i+3]-1,0));
| ~~~~~~~~~~^~
Main.cpp:55:43: error: invalid conversion from 'int (*)(int)' to 'int' [-fpermissive]
55 | dps.pb(calc(i+4,close[i+3]-1,0));
| ~~~~~~~~~~^~
| |
| int (*)(int)
Main.cpp:34:20: note: initializing argument 2 of 'dp calc(int, int, int)'
34 | dp calc(int l, int r, int type)
| ~~~~^
Main.cpp:57:26: warning: pointer to a function used in arithmetic [-Wpointer-arith]
57 | i = close[i+3];
| ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
Main.cpp:57:26: error: invalid conversion from 'int (*)(int)' to 'int' [-fpermissive]
57 | i = close[i+3];
| ~~~~~~~~~^
| |
| int (*)(int)
Main.cpp: In function 'int main()':
Main.cpp:144:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
144 | close[st.top()] = i;
| ^
Main.cpp:144:29: error: assignment of read-only location '*(close, (close + ((sizetype)st.std::stack<int>::top())))'
144 | close[st.top()] = i;
| ~~~~~~~~~~~~~~~~^~~