题解 | #谁是你的潜在朋友#

谁是你的潜在朋友

https://www.nowcoder.com/practice/0177394fb25b42b48657bc2b1c6f9fcc

#include <iostream>
#include <map>
using namespace std;
const int N = 201;
int a[N];
int book[N];

int main(){
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < n; i ++){
        cin >> a[i];
        book[a[i]] ++;
    }
    for(int i = 0; i < n; i ++){
        if(book[a[i]] - 1 == 0)
            cout << "BeiJu" << endl;
        else
            cout << book[a[i]] - 1 << endl;
    }

    return 0;
}

全部评论

相关推荐

头像
04-02 20:00
点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务