foo.cpp:29:27: error: 'int log [600001]' redeclared as different kind of symbol
int n, m, log[MAXN * 2 + 1], max, eulerTourLen;
^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\cmath:44:0,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\random:38,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_algo.h:65,
from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\algorithm:62,
from foo.cpp:3:
c:\mingw\include\math.h:159:24: error: previous declaration of 'double log(double)'
_CRTIMP double __cdecl log (double);
^
foo.cpp: In function 'void sparseTable()':
foo.cpp:74:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
log[i] = x - 1;
^
foo.cpp:74:16: error: assignment of read-only location '*(log + ((sizetype)i))'
log[i] = x - 1;
^
foo.cpp:74:16: error: cannot convert 'int' to 'double(double)' in assignment
foo.cpp: In function 'Node* rmq(int, int)':
foo.cpp:80:32: warning: pointer to a function used in arithmetic [-Wpointer-arith]
const int t = log[r - l];
^
foo.cpp:80:32: error: invalid conversion from 'double (__attribute__((__cdecl__)) *)(double)' to 'int' [-fpermissive]