Language: C++

#include <iostream>

using namespace std;

int main(){
  int n, m;
  int card[2][200];
  while(cin >> n >> m){
    for(int i=0;i<2*n;i++) card[0][i] = i;
    for(int i=0;i<m;i++){
      int cur = i%2, next = 1-i%2;
      int K; cin >> K;
      if(K>0){
        for(int i=0;i<2*n;i++) card[next][i] = card[cur][(i+K)%(2*n)];
      } else {
        for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
        for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      }
    }
    for(int i=0;i<2*n;i++) cout << card[m%2][i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   16 |         for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
      |                     ^
a.cc:16:24: error: found ':' in nested-name-specifier, expected '::'
   16 |         for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
      |                        ^
      |                        ::
a.cc:16:23: error: 'n' is not a class, namespace, or enumeration
   16 |         for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
      |                       ^
a.cc:17:9: error: expected primary-expression before 'for'
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |         ^~~
a.cc:16:61: error: expected ';' before 'for'
   16 |         for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
      |                                                             ^
      |                                                             ;
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |         ~~~                                                  
a.cc:17:9: error: expected primary-expression before 'for'
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |         ^~~
a.cc:16:61: error: expected ')' before 'for'
   16 |         for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
      |            ~                                                ^
      |                                                             )
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |         ~~~                                                  
a.cc:17:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |                     ^
a.cc:17:24: error: found ':' in nested-name-specifier, expected '::'
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |                        ^
      |                        ::
a.cc:17:23: error: 'n' is not a class, namespace, or enumeration
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |                       ^
a.cc:18:7: error: expected primary-expression before '}' token
   18 |       }
      |       ^
a.cc:17:65: error: expected ';' before '}' token
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |                                                                 ^
      |                                                                 ;
   18 |       }
      |       ~                                                          
a.cc:18:7: error: expected primary-expression before '}' token
   18 |       }
      |       ^
a.cc:17:65: error: expected ')' before '}' token
   17 |         for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
      |            ~                                                    ^
      |                                                                 )
   18 |       }
      |       ~                                                          
a.cc:18:7: error: expected primary-expression before '}' token
   18 |       }
      |       ^