文章
4
粉丝
302
获赞
1
访问
41.9k
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
int main(){
int n, m;
// cout << "Input person and book" << endl;
cin >> n >> m;
int temp;
int loveBook[n];
map<int, int> M;
for (int i = 0; i < n; i++)
{
cin >> temp;
loveBook[i] = temp;
M[temp]++;
}
for (int i = 0; i < n; i++)
{
temp = loveBook[i];
if ( M[temp]==1 )
{
cout << "BeiJu" <<endl;
continue;
}
cout << M[temp]-1 <<endl;
}
return 0;
}
登录后发布评论
找到原因了,但我一点也不开心,因为原题分明没有说输入有多个案例情况