C++

#include<string>
#include<cstring>
#include<algorithm>
int h[201];
int n[201];
using namespace std;
int main() {
	
	
	int N, M;
	while(cin >> N >> M) {
		memset(h, 0, sizeof(h));
		for (int i = 0; i < N; i++) {
			cin >> n[i];
			h[n[i]]++;
		}
		for (int i = 0; i < N; i++) {
			int temp = n[i];
			if (h[temp] == 1) {
				cout << "BeiJu" << endl;
			}
			else {
				cout << h[temp] - 1 << endl;
			}
		}

		
	}
	return 0;
}