foo.cpp: In function 'int main()':
foo.cpp:36:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (l > r) swap(l, r); if (k > w) swap(k, w);
^~
foo.cpp:36:32: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
if (l > r) swap(l, r); if (k > w) swap(k, w);
^~
foo.cpp:37:41: error: reference to 'next' is ambiguous
ymin[++cnt] = k, ymax[cnt] = w, next[cnt] = x[l - 1], x[l - 1] = cnt, num[cnt] = i;
^~~~
foo.cpp:8:59: note: candidates are: int next [1000005]
int n, m, cnt, tot, a[N], x[N], num[M], ymin[M], ymax[M], next[M], ans[M], bit[N], ds[N];
^~~~
In file included from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:66:0,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/istream:38,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/sstream:38,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/complex:45,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ccomplex:39,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/i686-w64-mingw32/bits/stdc++.h:52,
from foo.cpp:1:
C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
foo.cpp:38:41: error: reference to 'next' is ambiguous
ymin[++cnt] = k, ymax[cnt] = w, next[cnt] = x[r], x[r] = cnt, num[cnt] = i;
^~~~
foo.cpp:8:59: note: candidates are: int next [1000005]
int n, m, cnt, tot, a[N], x[N], num[M], ymin[M], ymax[M], next[M], ans[M], bit[N], ds[N];
^~~~
In file included from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:66:0,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/istream:38,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/sstream:38,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/complex:45,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ccomplex:39,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/i686-w64-mingw32/bits/stdc++.h:52,
from foo.cpp:1:
C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_iterator_base_funcs.h:205:5: note: template<class _ForwardIterator> _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type)
next(_ForwardIterator __x, typename
^~~~
foo.cpp:42:35: error: reference to 'next' is ambiguous
for (int j = x[i]; j; j = next[j]) {
^~~~
foo.cpp:8:59: note: candidates are: int next [1000005]
int n, m, cnt, tot, a[N], x[N], num[M], ymin[M], ymax[M], next[M], ans[M], bit[N], ds[N];
^~~~
In file included from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/stl_algobase.h:66:0,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/char_traits.h:39,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:40,
from C:/MinGW32/lib/gcc/i686-w64-mingw32/6