triangle.cpp:23:26: error: 'long long int yn [300000]' redeclared as different kind of entity
23 | int yp[300000], yn[300000], xp[300000], xn[300000];
| ^
In file included from /usr/include/features.h:461,
from /usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h:518,
from /usr/include/c++/10/cassert:43,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
from triangle.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:222:1: note: previous declaration 'double yn(int, double)'
222 | __MATHCALL (yn,, (int, _Mdouble_));
| ^~~~~~~~~~
triangle.cpp: In function 'int main()':
triangle.cpp:42:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
42 | yn[abs(y)]++;
| ^
triangle.cpp:42:14: warning: ISO C++ forbids incrementing a pointer of type 'double (*)(int, double) noexcept' [-Wpointer-arith]
42 | yn[abs(y)]++;
| ~~~~~~~~~^
triangle.cpp:42:14: error: lvalue required as increment operand
42 | yn[abs(y)]++;
| ^
triangle.cpp:51:78: warning: pointer to a function used in arithmetic [-Wpointer-arith]
51 | ans += (xp[coordX[i]] + xn[coordX[i]] - 1) * (yp[coordY[i]] + yn[coordY[i]] - 1);
| ^
triangle.cpp:51:64: warning: pointer to a function used in arithmetic [-Wpointer-arith]
51 | ans += (xp[coordX[i]] + xn[coordX[i]] - 1) * (yp[coordY[i]] + yn[coordY[i]] - 1);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
triangle.cpp:51:80: warning: pointer to a function used in arithmetic [-Wpointer-arith]
51 | ans += (xp[coordX[i]] + xn[coordX[i]] - 1) * (yp[coordY[i]] + yn[coordY[i]] - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
triangle.cpp:51:47: error: invalid operands of types 'long long int' and 'double (*)(int, double) noexcept' to binary 'operator*'
51 | ans += (xp[coordX[i]] + xn[coordX[i]] - 1) * (yp[coordY[i]] + yn[coordY[i]] - 1);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| long long int double (*)(int, double) noexcept