题目1156:谁是你的潜在朋友
//本题是简单题目,错误出现在一个case处理结束之后,忘记重置变量
#include<iostream>
using namespace std;
int stu[1205]={0};
int book[1205] = {0};
int main()
{
int n=0,m=0,i=0,temp=0;
while (cin >> n)
{
cin >> m;
for (i=0; i<1204; i++)
{
stu[i] = book[i] = 0;
}
for (i=0; i<n; i++)
{
cin >> temp;
book[temp]++;
stu[i] = temp;
}
for (i=0; i<n; i++)
{
if (book[stu[i]] == 1)
{
cout << "BeiJu" << endl;
}
else
{
cout << book[stu[i]]-1 <<endl;
}
}
}
return 0;
}