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<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 <bits/stdc++.h>
#include <string.h>
#define rep(i, n) for(int i = 0; i<(n); i++)
using namespace std;
typedef long long ll;
//pi = 3.14159265358979323846

int main() {

    int n;
    cin >> n;
    vector<int> vec(n);
    rep(i, n){
        cin >> vec.at(i);
    }
    int m;
    cin >> m;
    rep(i, m){
        int wa;
        cin >> wa;
        int vecsin = vec.at(wa - 1) + 1;
        if(find(vec.begin(), vec.end(), vecsin) == vec.end() && vecsin <= 2019) vec.at(wa - 1) += 1;
        
    }
    rep(i, n){
        cout << vec.at(i) << endl;
    }

}

C++: #include<iostream>
#include<stdio.h>

using namespace std;

int main(){
	int n, m;
	cin >> n;
	int x[2020];
	for (int i = 1; i <= n; i++){
		cin >> x[i];
	}
	cin >> m;
	int a[2020];
	for (int j = 1; j <= m; j++){
		cin >> a[j];
		x[a[j]] += 1;
		if (x[a[j]] == 2020)x[a[j]]--;
		if (x[a[j]] == x[a[j] + 1])x[a[j]]--;
	}
	for (int l = 1; l <= n; l++){
		cout << x[l] << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
signed main() {
	int n, m, x[123];
	cin >> n; for (int i = 0; i < n; i++)cin >> x[i]; cin >> m;
	x[n] = 2020;
	for (int i = 0; i < m; i++) {
		int p; cin >> p;
		p--;
		x[p] = min(x[p] + 1, x[p + 1] - 1);
	}
	for (int i = 0; i < n; i++)cout << x[i] << endl;
}

C++: /*
17D8101013F 森田　匡博
JOI0653.cpp 2019/10/31
ID:key4 使用言語:C++
*/

#include <iostream>
#include <cmath>

int main() 
{
  int N;
  std::cin >> N;

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

  int M;
  std::cin >> M;

  int A[M];
  for(int i = 0; i < M; i++) {
    std::cin >> A[i];
  }

  for(int i = 0; i < M; i++) {
    X[A[i]-1]++;
    if(X[A[i]-1] == X[A[i]]) {
      X[A[i]-1]--;
    }
    if(X[A[i]-1] >= 2019) {
      X[A[i]-1] = 2019;
    }
  }

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

  return 0;
}

C++: #include<cstdio>
using namespace std;
int main()
{
	int n,x[101],m,a,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x[i]);
	}
	scanf("%d",&m);
	for(i=1;i<=m;i++){
		scanf("%d",&a);
		if(x[a]+1!=x[a+1]&&x[a]!=2019){
			x[a]++;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",x[i]);
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<math.h>
typedef long long int ll;
using namespace std;

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