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>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
using P=pair<long long,long long>;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);  
  
  int n;
  cin >> n;
  map<int,int>mp1;
  map<int,int>mp2;
  rep(i,n){
    int x;
    cin >> x;
    mp1[i+1]=x;
    mp2[x]=i+1;
  }
  int m;
  cin >> m;
  rep(i,m){
    int a;
    cin >> a;
    if(mp1[a]==2019 ||mp2[mp1[a]+1]>0)continue;
    mp2[mp1[a]]=0;
    mp2[mp1[a]+1]=a;
    mp1[a]++;
  }
  for(auto p:mp1){
    cout << p.second << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 3005
const int INF = 1e9 + 7;

int used[ARRAY_MAX];

int main() {

	int n, m;
	cin >> n;
	auto a = make_v<int>(n + 10);
	fill_v(a, 0);

	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		used[a[i]]++;
	}

	cin >> m;

	for (int i = 0; i < m; i++)
	{
		int tmp;
		cin >> tmp;
		if (used[a[tmp] + 1] == 0)
		{
			used[a[tmp] + 1]++;
			used[a[tmp]]--;
			a[tmp] = min(a[tmp]+1, 2019);
		}
	}

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

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


int main() 
{
	int PIECE_NUM = 0;
	std::vector<int> piecePos;
	int opeNum = 0;

	auto haveSameNum = [&](int pos) -> bool
	{
		for (int pPos : piecePos) if (pPos == pos + 1) return true;
		return false;
	};
	

	std::cin >> PIECE_NUM;
	for (int i = 0; i < PIECE_NUM; ++i)
	{
		int pos = 0;
		std::cin >> pos;
		piecePos.emplace_back(pos);
	}
	std::cin >> opeNum;

	// 駒を動かす
	for (int i = 0; i < opeNum; ++i)
	{
		int no = 0;
		std::cin >> no;
		
		int pos = piecePos[no-1];

		if (pos == 2019) continue;
		else if(haveSameNum(pos)) continue;

		piecePos[no-1] ++;
	}	

	for (int pPos : piecePos) std::cout << pPos << std::endl;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,i,n,m,x[100];
	cin>>n;
	for(i=0;i<n;i++) cin>>x[i];
	cin>>m;
	for(i=0;i<m;i++){
		cin>>a;
		if((a==n || x[a]!=x[a-1]+1) && x[a-1]<2019) x[a-1]++;
	}
	for(i=0;i<n;i++) cout<<x[i]<<endl;
	return 0;
}

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

int main(){
    int n, m;
    bool board[2020] = {0};
    int x[101];
    cin >> n;
    for(int i=1;i<=n;i++){
        cin >> x[i];
        board[x[i]] = true;
    }
    cin >> m;
    for(int i=0;i<m;i++){
        int a;
        cin >> a;
        if(x[a]==2019 || board[x[a]+1]) continue;
        board[x[a]] = false;
        board[x[a]+1] = true;
        x[a]++;
    }

    for(int i=1;i<=n;i++) cout << x[i] << endl;
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int n, m;
bool exist[2100];
map<int, int> pos;

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x; cin >> x;
        pos[i] = x;
        exist[pos[i]] = true;
    }

    cin >> m;
    for (int i = 1; i <= m; i++) {
        int a; cin >> a;
        if (exist[pos[a]+1] || pos[a] == 2019) continue;
        // printf("x%d: %d -> %d\n", a, pos[a], pos[a]+1);
        exist[pos[a]] = false;
        exist[pos[a+1]] = true;
        pos[a]++;
    }
    for (int i = 1; i <= n; i++) cout << pos[i] << endl;
}

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

int CEIL(int a, int b) {return (a - 1) / b + 1;}

int main(){

	int N, M;
	int X[100];
	cin >> N;

	for(int i = 0; i< N; i++){
		cin >> X[i];
	}

	cin >> M;
	int buf;
	for(int i = 0; i < M; i++){
		cin >> buf;
		if(X[buf-1] == 2019) continue;
		if(buf-1 != N - 1)
			if(X[buf-1] + 1 == X[buf]) continue;
		X[buf-1]++;
	}
	
	for(int i = 0; i< N; i++){
		cout << X[i] << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define PI 3.14159265359

int main(){
    iostream::sync_with_stdio(false);
    
    int N;
	cin >> N;
	int P[2020] = {};//i番目のマスにおかれている駒
	int A[2020];//i番目の駒が置かれている位置
	for(int i=0; i<N; i++){
		int X;
		cin >> X;
		A[i+1] = X;
		P[X] = i+1;
	}

	int M;
	cin >> M;
	for(int i=0; i<M; i++){
		int a;
		cin >> a;
		if(A[a] != 2019 && P[A[a]+1] == 0){
			P[A[a]] = 0;
			P[A[a]+1] = a;
			A[a]++;
		}
	}

	for(int i=1; i<=N; i++){
		cout << A[i] << endl;
	}
    
    return 0;
}