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
}

Python: a=int(input())
N=list(map(int,input().split(" ")))
b=int(input())
M=list(map(int,input().split(" ")))

#a=2
#N=[1,2016]
#b=4
#M=[2,2,2,2]

for index,i in enumerate(M):
#    print(i)
    if N[i-1]+1 in N or N[i-1]==2019:
#        print(N[i-1])
        continue
    else:
        N[i-1]+=1
    
for i in N:
    print(i)

Python: n = int(input())
x = list(map(int,input().split()))
m = int(input())
a = list(map(int,input().split()))

for i in range(m):
    a[i] -= 1

for i in a:
    if i == n-1:
        x[i] = min(x[i]+1, 2019)
    else:
        x[i] = min(x[i]+1, x[i+1]-1)

for i in x:
    print(i)

Python: MAX_PLACE = 2019
def sugoroku(N, X, M, A):
    X.append(MAX_PLACE + 1)
    for a in A:
        if(X[a - 1] + 1 == X[a]):
            pass
        else:
            X[a-1] += 1
    X.pop()
    for i in range(N):
        print(X[i])

#sugoroku(3, [2, 3, 6], 2, [1, 3])
#sugoroku(2, [1, 2016], 4, [2,2,2,2])
#sugoroku(4, [1001, 1002, 1003, 1004], 7, [1, 2, 3, 4, 3, 2, 1])

def main():
    N = int(input())
    X = list(map(int, input().split()))
    M = int(input())
    A = list(map(int, input().split()))
    sugoroku(N, X, M, A)

main()

Python: _map = [200 for i in range(2020)]
n = int(input())
X = list(map(int, input().split()))
M = int(input())
A = list(map(int, input().split()))
for i in range(n):
    _map[X[i]] = i+1
for i in A:
    if _map.index(i)+1 < 2020 and _map[_map.index(i)+1] == 200:
        _map[_map.index(i)+1] = i
        _map[_map.index(i)] = 200
for i in range(n):
    print(_map.index(i+1))

Python: N = int(input())
pieces = {}
X = list(map(int, input().split()))
for p in range(N):
    pieces.setdefault(p+1, X[p])
M = int(input())
move = list(map(int, input().split()))
for i in range(M):
    destination = pieces[move[i]] + 1
    if destination > 2019 or destination in pieces.values():
        continue
    pieces[move[i]] = destination
for i in range(N):
    print(pieces[i+1])

Python: N = int(input())
koma = list(map(int,input().split()))
M = int(input())
a = list(map(int,input().split()))

for i in a:
    if i == N:
        koma[i-1] = min(koma[i-1]+1, 2019)
    else:
        koma[i-1] = min(koma[i-1]+1, koma[i]-1)
        
for i in koma:
    print(i)

Python: n = int(input())
Pieces = list(map(int, input().split()))

t = int(input())
commands = list(map(int, input().split()))

for piece in commands:
    if piece != len(Pieces):
        if (Pieces[piece-1]+1) == Pieces[piece] or (Pieces[piece-1]) == 2019:
            pass
        else:
            Pieces[piece-1]+=1
    else:
        if Pieces[piece-1] != 2019:
            Pieces[piece-1]+=1

for i in Pieces:
    print(i)

Python: N = int(input())
P_locat = [int(i) for i in input().split()]
M = int(input())
P = [int(i) for i in input().split()]

for i in range(M):
    tmp_locat = P_locat[P[i]-1] + 1
    if tmp_locat <= 2019 :
        P_locat[P[i]-1] += 1
    if P[i] != N:
        if P_locat[P[i]-1] == P_locat[P[i]]:
            P_locat[P[i]-1] -= 1
for i in range(N):
    print(P_locat[i])

Python: n = int(input())
xlst = list(map(int, input().split()))
m = int(input())
alst = list(map(int, input().split()))
for a in alst:
    if (a == n or xlst[a] - xlst[a - 1] > 1) and xlst[a - 1] < 2019:
        xlst[a - 1] += 1

print(*xlst, sep="\n")

Python: ##petite_prig   ono takaki

#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    X=LI()
    M=I()
    A=LI_()

    exist=[0]*2021
    for i,x in enumerate(X):
        exist[x]+=1

    for a in A:
        where = X[a]
        if exist[where+1] or where == 2019:
            continue
        else:
            exist[where+1]+=1
            exist[where]-=1
            X[a]+=1
    print(*X,sep="\n")

if __name__ == '__main__':
    main()

C++: #include<iostream>

using namespace std;

int main(){
	int board[2020] = {};

	int n;
	cin >> n;

	int x[n];
	for(int i=0; i<n; i++){
		cin >> x[i];
		board[x[i]] = 1;
	}

	int m;
	cin >> m;

	int idx;
	for(int i=0; i<m; i++){
		cin >> idx;
		if(board[x[idx-1]+1] == 1) continue;
		if(x[idx-1] == 2019) continue;
		board[x[idx-1]] = 0;
		board[x[idx-1]+1] = 1;
		x[idx-1]++;
	}

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

	return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main() {
	int a[2019];
	int i, j, l, n,m,f;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		cin >> a[i];
	}
	scanf("%d", &m);
	for (i = 0; i < m; i++) {

		scanf("%d", &l);
		l--;
		f = 0;
		for (j = 0; j < n; j++) {
			if ((a[l] + 1) == a[j]) { f++; }
			if ((a[l] == 2019)) { f++; }

		}
		if (f == 0)a[l]++;
	}
	for (i = 0; i < n; i++) {
		printf("%d\n", a[i]);
	}
}

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

int main() {
    int N, x[102], M, a, i, l;

    cin >> N;
    for(i = 1; i <= N; i++) {
        cin >> x[i];
    }
    cin >> M;
    for(l = 0; l < M; l++) {
        cin >> i;
        if(i == N) {
            if(x[i] < 2019) {
                x[i]++;
            }
        } else {
            if (x[i]+1 < x[i+1]) {
                x[i]++;
            }
        }
    }
    for(i = 1; i <= N; i++) {
        cout << x[i] << endl;
    }
    return 0;
}

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

using namespace std;

int main(){
  vector<bool> v(2020);
  int n;cin>>n;
  vector<int> x(n);
  for(int i=0;i<n;i++){
    cin>>x[i];
    v[x[i]] = true;
  }
  int m;cin>>m;
  for(int i=0;i<m;i++){
    int a;cin>>a;
    if(!v[x[a-1]+1] && x[a-1]!=2019){
      v[x[a-1]+1] = true;
      v[x[a-1]] = false;
      x[a-1]++;
    }
  }
  for(int i=0;i<x.size();i++){
    cout<<x[i]<<endl;
  }
}

C++: #include <bits/stdc++.h>

#define MAX 2020
#define P 101

int table[MAX];
int idxs[P];

void move(int pid) {
    if (table[idxs[pid]+1] == 0 && idxs[pid]+1 <= 2019) {
        table[idxs[pid]] = 0; table[idxs[pid]+1] = 1;
        idxs[pid]++;
    }
}


int main()
{
    int N, M, tmp;
    for (int i = 0; i < 2020; i++) {
        table[i] = 0;
    }

    std::scanf("%d", &N);
    for (int i = 1; i <= N; i++) {
        std::scanf("%d", &tmp);
        idxs[i] = tmp;
        table[tmp] = 1;
    }

    std::scanf("%d", &M);
    for (int i = 0; i < M; i++) {
        std::scanf("%d", &tmp);
        move(tmp);
    }

    for (int i = 1; i <= N; i++) {
        std::printf("%d\n", idxs[i]);
    }



    return 0;
}