Language: C++

//PCK2014pre 7 ??????????????¬???/////

#include<iostream>
#include<string.h>
using namespace std;
int prev[200000],next[200000];

int main()
{
	int N,M,Q,a,q,o;
	int ba = 0;
	cin >> N >> M >> Q;
	/*for(int i=0;i<N;i++){
		if(i==0){
			prev[i] = N - 1;
			next[i] = 1;
		}
		else if(i == N-1){
			prev[i] = N - 2;
			next[i] = 0;
		}
		else{
			prev[i] = i - 1;
			next[i] = i + 1;
		}
	}*/
	for(int i=0;i<N;i++){
        prev[i] = (i-1+N)%N;
        next[i] = (i+1)%N;
    }
	
	for(int i=0;i<M;i++){
		cin >> a;
		for(int j=0;j<a;j++)
			p=a%2==1?prev[p]:next[p];
			
		next[prev[ba]] = next[ba];
		prev[next[ba]] = prev[ba];
		o = next[ba];
		prev[ba] = -1;
		next[ba] = -1;
		ba = o;
	}
	
	for(int i=0;i<Q;i++){
		cin >> q;
		if(prev[q] != -1) cout << "1" << endl;
		else cout << "0" << endl;
	}
	/*for(int i=0;i<N;i++)
		cout << i << " " << prev[i] << " " << next[i] << endl;
	cout << "AAA";*/
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: reference to 'prev' is ambiguous
   28 |         prev[i] = (i-1+N)%N;
      |         ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:29:9: error: reference to 'next' is ambiguous
   29 |         next[i] = (i+1)%N;
      |         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:35:25: error: 'p' was not declared in this scope
   35 |                         p=a%2==1?prev[p]:next[p];
      |                         ^
a.cc:35:34: error: reference to 'prev' is ambiguous
   35 |                         p=a%2==1?prev[p]:next[p];
      |                                  ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:35:42: error: reference to 'next' is ambiguous
   35 |                         p=a%2==1?prev[p]:next[p];
      |                                          ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:37:17: error: reference to 'next' is ambiguous
   37 |                 next[prev[ba]] = next[ba];
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:37:22: error: reference to 'prev' is ambiguous
   37 |                 next[prev[ba]] = next[ba];
      |                      ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:37:34: error: reference to 'next' is ambiguous
   37 |                 next[prev[ba]] = next[ba];
      |                                  ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:38:17: error: reference to 'prev' is ambiguous
   38 |                 prev[next[ba]] = prev[ba];
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:38:22: error: reference to 'next' is ambiguous
   38 |                 prev[next[ba]] = prev[ba];
      |                      ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:38:34: error: reference to 'prev' is ambiguous
   38 |                 prev[next[ba]] = prev[ba];
      |                                  ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:39:21: error: reference to 'next' is ambiguous
   39 |                 o = next[ba];
      |                     ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:40:17: error: reference to 'prev' is ambiguous
   40 |                 prev[ba] = -1;
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~
a.cc:41:17: error: reference to 'next' is ambiguous
   41 |                 next[ba] = -1;
      |                 ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:6:18: note:                 'int next [200000]'
    6 | int prev[200000],next[200000];
      |                  ^~~~
a.cc:47:20: error: reference to 'prev' is ambiguous
   47 |                 if(prev[q] != -1) cout << "1" << endl;
      |                    ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:6:5: note:                 'int prev [200000]'
    6 | int prev[200000],next[200000];
      |     ^~~~