思路:hash
代码:
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
const int maxm = 210;
const int maxn = 210;
int main(){
// freopen("a.txt", "r", stdin);
int n, m;
while(cin >> n >> m){
int hash[maxm] = {0};
int reader[maxn];
for(int i = 0; i < n; ++i){
cin >> reader[i];
hash[reader[i]]++;
}
for(int i = 0; i < n; ++i){
if(hash[reader[i]] == 1){
cout << "BeiJu" << endl;
}
else{
cout << hash[reader[i]] - 1 << endl;
}
}
}
return 0;
}