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 namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }





int main() {
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i, n) cin >> x[i];
    
    int m;
    cin >> m;
    rep(i, m) {
        int a;
        cin >> a;
        a--;
        if (x[a] == 2019) continue;
        rep(j, n) {
            if (x[j] == x[a] + 1) break;
            if (j == n - 1) {
                x[a]++;
            }
        }
    }
    rep(i, n) cout << x[i] << endl;
}

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

int main()
{
    int N;
    cin >> N;
    vector<int> x(N + 1);
    for(int i = 0;i < N;i++){
        cin >> x[i];
    }
    x[N] = 2020;
    int M;
    cin >> M;
    for(int i = 0;i < M;i++){
        int A;
        cin >> A; --A;
        if(x[A] + 1 < x[A + 1]) ++x[A];
    }
    for(int i = 0;i < N;i++){
        cout << x[i] << endl;
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	int n;
	vector<int> x;

	for (cin >> n; n--; )
	{
		int p;
		cin >> p;
		x.push_back(p);
	}

	int m;
	for (cin >> m; m--;)
	{
		int a;
		cin >> a;

		a--;
		bool ok = true;
		for (int i = 0; i < x.size(); i++)
		{
			if (i != a)
			{
				if (x.at(a) + 1 == x.at(i))
				{
					ok = false;
					break;
				}
			}
		}

		if (ok)
		{
			x.at(a)++;
			if (x.at(a) > 2019)
			{
				x.at(a) = 2019;
			}
		}
	}

	for (auto i: x)
	{
		cout << i << endl;
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;

int n, x[2019];
int m, a[102];


int main() {

	cin >> n;
	REP(i, 1, n + 1)cin >> x[i];
	cin >> m;
	rep(i, m)cin >> a[i];

	rep(i, m) {
		if (a[i] != n) {
			if (x[a[i]] + 1 != x[a[i] + 1])x[a[i]]++;
		}
		else if (x[a[i]] != 2019)x[a[i]]++;
	}

	REP(i, 1, n + 1) {
		cout << x[i] << endl;
	}

	return 0;
}

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

using namespace std;

int main()
{
    int n;        
    int a;
    int zahyo;
    vector<int> x(2040,0);
    cin >> n;
    vector<bool> masu(2040,false);
    for(int i=1;i<=n;i++)
    {
        // int l;
        cin >> x.at(i);
        masu.at(x.at(i))=true;
    }
    int m;
    cin >> m;
    for(int i=1;i<=m;i++)
    {

        cin >> a;
        if(masu.at(x.at(a)+1)!=true&&x.at(a)+1<=2019)
        {
            masu.at(x.at(a))=false;
            masu.at(x.at(a)+1)=true;
            x.at(a)+=1;
        }
    }
    for(int i=1;i<=2019;i++)
    {
        if(masu.at(i)==true)
        {
            cout << i << endl;
        }
    }
    return(0);
}

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

void solve() {
    int n;
    std::cin >> n;

    std::vector<int> xs(n);
    for (auto& x : xs) std::cin >> x;
    xs.push_back(2020);

    int q;
    std::cin >> q;
    while (q--) {
        int i;
        std::cin >> i;
        --i;
        if (xs[i] + 1 < xs[i + 1]) ++xs[i];
    }

    xs.pop_back();
    for (auto x : xs) std::cout << x << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}

C++: #include <iostream>
int main(){
  int n,m;
  std::cin>>n;
  int X[n];
  for(int i=0;i < n;i++){
    std::cin>>X[i];
  }
  std::cin>>m;
  int A[m];
  for(int i=0;i < m;i++){
    std::cin>>A[i];
  }
  
  for(int i=0;i<m;i++){ 
    int cc = X[A[i]-1] + 1;
    int aa = 0;
    if(cc > 2019){}
    else{
    for(int j =0;j<n;j++){
      if(cc==X[j]) aa += 1; 
    }
    if(aa == 0){
      X[A[i]-1] += 1;
    }
    }

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

C++: #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define all(vec) vec.begin(), vec.end()

int main() {
    int n;
    scanf("%d", &n);
    vector<int> vec(n+1);
    rep(i,n) scanf("%d", &vec.at(i));
    vec.at(n) = 2020;
    int m;
    scanf("%d", &m);
    rep(i,m) {
        int c;
        scanf("%d", &c);
        if (vec.at(c) != vec.at(c-1)+1) vec.at(c-1)++;
    }
    rep(i,n) printf("%d\n", vec.at(i));
}

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

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

C++: #include <bits/stdc++.h>
using namespace std;
#define ll long long
template <typename T>
bool PN(T x){ if (x <= 1) return false; if (x == 2) return true; for (int i = 2; i < sqrt(x) + 1; i++) if (x % i == 0) return false; return true;}
const ll MOD = 1e9+7;
long long Comb(int n, int i){long long ans = 1; if(i == 0 || i == n) return 1; else {for(int j = 1; j <= i; ++j){
      ans *=(n+1-j);
      ans /= j;
      ans %= MOD;} }return ans;}

int main(void){
    int n; cin >> n;
    int masu[2020] = {};
    masu[2020] = -1;
    for(int i = 1; i <= n; ++i){
        int tmp; cin >> tmp;
        masu[tmp] = i;
    }
    int q; cin >> q;
    while(q--){
        int koma; cin >> koma;
        for(int j = 1; j <= 2019; ++j){
            if(masu[j] == koma){
                if(masu[j+1] == 0){
                    swap(masu[j], masu[j+1]);
                    break;
                }
            }
        }
    }
    for(int i = 1; i <= n; ++i){
        for(int j = 1; j <= 2019; ++j){
            if(masu[j] == i) cout << j << endl;
        }
    }
}

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

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