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

谁是你的潜在朋友

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

#include <stdio.h>

int main() {
    int m, n;
    int cnt[201] = {0};
    while (scanf("%d %d", &n, &m) != EOF) {
        int a[n];
        for (int i = 0; i < n; i++) {
            int temp;
            scanf("%d", &temp);
            a[i] = temp;
            cnt[temp]++;
        }
        for (int i = 0; i < n; i++) {
            int temp = cnt[a[i]] - 1;
            if (temp > 0) {
                printf("%d\n", temp);
            } else if (temp == 0) {
                printf("BeiJu\n");
            }
        }
    }
    return 0;
}

全部评论

相关推荐

LZHR:老哥你从投递简历测评完到一面中间隔了多久呀,我这边已经过了五天了仍显示简历筛选中是不是就是挂了
腾讯求职进展汇总
点赞 评论 收藏
分享
03-02 08:18
集美大学 Java
钱嘛数字而已:没有赛事奖项么?另外,项目经历字有点多哈,建议突出一下重点:用的什么技术,解决什么问题,达到什么效果。
大家都开始春招面试了吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务