Go: package main

import (
	"fmt"
)

func main() {
	var n int // こま数

	_, _ = fmt.Scan(&n)

	xa := make([]int, n) // こま座標

	for i:= 0;i < n ; i++ {
		_, _ = fmt.Scan(&xa[i])
	}

	var m int // 操作数

	_, _ = fmt.Scan(&m)

	ma := make([]int, m) // 操作対象

	for i:= 0;i < m ; i++ {
		_, _ = fmt.Scan(&ma[i])
	}

	for _, v := range calc(xa, ma) {
		fmt.Println(v)
	}
}

func calc(xa []int, ma []int) []int {
	for _, v := range ma {
		if xa[v-1] < 2019 {
			if  len(xa) != v {
				if xa[v]-1 != xa[v-1] {
					xa[v-1]++
				}
			} else {
				xa[v-1]++
			}
		}
	}
	return xa
}

C++: #include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end()) cout << " ";
    }
    cout << endl;
};

int main() {
    int n, m, t;
    cin >> n;
    vector<int> M(2020, 0);
    vector<int> P(n + 1, 0);
    rep(i, 1, n + 1) {
        cin >> t;
        M[t] = i;
        P[i] = t;
    }
    cin >> m;
    rep(i, m) {
        cin >> t;
        if(P[t] != 2019 && M[P[t] + 1] == 0) {
            M[P[t]] = 0;
            M[P[t] + 1] = t;
            P[t]++;
        }
    }

    rep(i, 1, n + 1) { cout << P[i] << "\n"; }
}

C++: #include <iostream>

#define GOAL 2019
#define MAX 100

using namespace std;

int main(void)
{
  int N;
  cin >> N;
  int X[MAX+1];
  int P[GOAL+2] = {0};
  for(int i = 1; i <= N; i++) {
    cin >> X[i];
    P[X[i]] = 1;
  }
  int M;
  cin >> M;
  int A[MAX];
  for(int i = 0; i < M; i++) cin >> A[i];

  for(int i = 0; i < M; i++) {
    if(P[X[A[i]]+1] == 0 && X[A[i]] != GOAL) {
      P[X[A[i]]+1] = 1;
      P[X[A[i]]] = 0;
      X[A[i]]++;
    }
  }

  for(int i = 1; i <= N; i++) cout << X[i] << endl;

  return 0;
}

C++: #include <bits/stdc++.h>
typedef long long LL;
using namespace std;

int main(){
  int n; cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i ++) cin >> a[i];
  int m; cin >> m;
  for (int i = 0; i < m; i ++) {
    int t; cin >> t;
    t --;
    if ((a[t] + 1 == a[t + 1] && t < n) || a[t] == 2019) continue;
    a[t] ++;
  }

  for (int i = 0; i < n; i ++) {
    cout << a[i] << endl;
  }
}

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

int N;
int X[1000] = {0};
int M;
int A;


int main(){
	cin >> N;
	for(int i = 1; i <= N;i++){
		cin >> X[i];
	}
	X[N+1] = 2020;
	cin >> M;
	for(int i = 0; i < M; i++){
		cin >> A;
		if(X[A] < 2019 && X[A+1] > X[A] + 1){
			X[A]++;
		}
	}
	for(int i = 1; i <= N; i++){
		cout << X[i] << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> v(n), used(2020, 0);
    for(int i = 0; i < n; i++)
    {
        cin >> v[i];
        used[v[i]] = 1;
    }
    int m; cin >> m;
    for(int i = 0; i < m; i++)
    {
        int x; cin >> x;
        x--;
        if(used[v[x] + 1] || v[x] + 1 >= 2020) continue;
        swap(used[v[x]], used[v[x] + 1]);
        v[x]++;
    }
    for(int i = 0; i < n; i++) cout << v[i] << endl;
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std; 
int main(void){
	int n;
	int x[101];
	int m;
	int a[101];
	cin>>n;
	int i;
	for(i=1;i<=n;i++){
		cin>>x[i];
	}
	cin>>m;
	for(i=0;i<m;i++){
		cin>>a[i];
	}
	for(i=0;i<m;i++){
		if(x[a[i]]+1!=x[a[i]+1]&&x[a[i]]+1!=2020){
			x[a[i]]++;
		}
	}
	for(i=1;i<=n;i++){
		cout<<x[i]<<endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define OUT(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    int n; cin >> n;
    vector<int> v(n);
    REP(i,n) cin >> v[i];
    int m; cin >> m;
    REP(i,m) {
        int a; cin >> a;
        a--;
        if (find(ALL(v),v[a]+1) == v.end() && v[a] != 2019) v[a]++;
    }

    REP(i,v.size()) cout << v[i] << endl;

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int s[2020]={},n,m,x[100],a[100];
  cin>>n;
  for(int i=0;i<n;++i){
    cin>>x[i];
    s[x[i]]=1;
  }
  cin>>m;
  for(int i=0;i<m;++i){
    cin>>a[i];
    if(x[a[i]-1]!=2019){
      if(s[x[a[i]-1]+1]==0){
	s[x[a[i]-1]]=0; s[x[a[i]-1]+1]=1;
	x[a[i]-1]++;
      }
    }
  }
  for(int i=0;i<n;++i) cout<<x[i]<<endl;
  return 0;
}

C++: 
#include <iostream>
#include<vector>

using namespace std;
int main(){
  int N,M,x,a;
  vector<int> X;
  vector<int> A;

  cin >> N;
  for(int i=0;i<N;i++){
    cin >> x;
    X.push_back(x);
  }

  cin >> M;
  for(int i=0;i<M;i++){
    cin >> a;
    A.push_back(a);
  }


  for(int i=0;i<M;i++){
    bool bo=true;
    int sub=A[i]-1;

    for(int j=0;j<N;j++){
      if((X[sub]+1)==X[j]){
	bo=false;
      }
    }
    if((X[sub])==2019){
      bo=false;
    }

    else if(bo==true){
      X[sub]+=1;
    }

  }


  for(int i=0;i<N;i++){
    cout << X[i] << "\n";
  }
}

C++: #include <iostream>
using namespace std;

#define GOAL 2019

int main(void){
  int x[200]={0};
  int n,m;
  
  cin >> n;
  for (int i=0; i<n; i++){
    int t;
    cin >> t;
    x[i]=t;
  }
  cin >> m;
  for (int i=0; i<m; i++){
    int a;
    cin >> a; a--;
    if (x[a]!=GOAL && x[a+1]-x[a]!=1){
      x[a]++;
    }
  }
  for (int i=0; i<n; i++){
    cout << x[i] << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;

int n, m, x[2000], a[101];

int main(){
    cin >> n;
    for (int i = 0; i < n; i++)cin >> x[i];
    cin >> m;
    for (int i = 0; i < m; i++){
        cin >> a[i];
        a[i]--;
        if (a[i] + 1 == n)x[a[i]] = min(x[a[i]] + 1, 2019);
        else if (x[a[i]] + 1 < x[a[i] + 1])x[a[i]]++;
    }
    for (int i = 0; i < n; i++)cout << x[i] << endl;
}

C++: // Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
signed main() {
  int N; cin >> N;
  vector<int> X(N);
  for (int i = 0; i < N; i++) cin>>X[i];
  int M; cin >> M;
  vector<int> A(M);
  for (int i = 0; i < M; i++) cin>>A[i];
  
  for (int i = 0; i < M; i++) {
    int ok = 1;
    for (int j = 0; j < N; j++) {
      if (X[A[i]-1]+1 == X[j]) {
        ok = 0;
        break;
      }
    }
    if (ok && X[A[i]-1] != 2019) {
      X[A[i]-1]++;
    }
  }
  
  for (int i = 0; i < N; i++) {
    cout << X[i] << endl;
  }
}

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

int main(void){
  int N;
  cin >> N;
  int X[N];
  for(int i = 0; i < N; i++)
    cin >> X[i];
  int M;
  cin >> M;
  int A[M];
  for(int i = 0; i < M; i++)
    cin >> A[i];
  for(int i = 0; i < M; i++){
    if(X[A[i]-1]+1 == X[A[i]]){
      continue;
    }
    else{
      if(X[A[i]-1] == 2019){
	continue;
      }
      else{
	X[A[i]-1] += 1;
      }
    }
  }
  for(int i = 0; i < N; i++){
    cout << X[i] << "\n";
  }
  return 0;
}