文章

85

粉丝

0

获赞

577

访问

13.2k

头像
谁是你的潜在朋友 题解:
P1225 北京大学机考题
发布于2026年3月6日 17:49
阅读数 83

#include <bits/stdc++.h>
using namespace std;


int main() {
    int n,m;
    while(cin>>n>>m) {
        map<int,int>mp;

        int stu[n];
        int book;
        for(int i=0;i<n;i++) {
            cin>>book;
            stu[i]=book;
           mp[book]++;
        }
        for (int i=0;i<n;i++) {
            if(mp[stu[i]]>=2) {
                cout<<mp[stu[i]]-1<<endl;
            }
            else {
                cout<<"BeiJu"<<endl;
            }
        }
    }
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发