Language: C++

#include <bits/stdc++.h>
using namespace std;

int N, M, Q;
int erased[100001];
int next[100001];

int main() {
    cin >> N >> M >> Q;
    for (int i = 0; i < N; i++) next[i] = (i + 1) % N;
    for (int i = 0; i < N; i++) erased[i] = 1;

    int c = 0;
    for (int i = 0; i < M; i++) {
        int a; cin >> a;
        if (a % 2) {
            a = N - (a % N);
        }
        for (int j = 0; j < a - 1; j++) {
            c = next[c];
        }
        erased[next[c]] = 0;
        next[c] = next[next[c]];
        c = next[c];
        N--;
    }

    for (int i = 0; i < Q; i++) {
        int a; cin >> a;
        cout << erased[a] << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: reference to 'next' is ambiguous
   10 |     for (int i = 0; i < N; i++) next[i] = (i + 1) % N;
      |                                 ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc: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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:20:17: error: reference to 'next' is ambiguous
   20 |             c = next[c];
      |                 ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:22:16: error: reference to 'next' is ambiguous
   22 |         erased[next[c]] = 0;
      |                ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:23:9: error: reference to 'next' is ambiguous
   23 |         next[c] = next[next[c]];
      |         ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:23:19: error: reference to 'next' is ambiguous
   23 |         next[c] = next[next[c]];
      |                   ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:23:24: error: reference to 'next' is ambiguous
   23 |         next[c] = next[next[c]];
      |                        ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~
a.cc:24:13: error: reference to 'next' is ambiguous
   24 |         c = next[c];
      |             ^~~~
/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:5: note:                 'int next [100001]'
    6 | int next[100001];
      |     ^~~~