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

谁是你的潜在朋友

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;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
07-10 12:05
点赞 评论 收藏
分享
06-15 20:57
已编辑
门头沟学院 Java
CARLJOSEPH...:年轻人有傲气很正常,但是建议工作前洗净傲气。 说实在的,什么奖学金什么奖项的都很一般。尊重你的老师,在有时间的时候去上课,真遇到走不开的事,请态度端正地向你的老师说明情况,请求请假。我相信任何一个有师德的老师都会允许的(我的老师就是这样)。
点赞 评论 收藏
分享
zzzzhz:兄弟你先猛猛投简历至少三百家,能约到面试就去面。最近可以速成智能小车,智慧家居烂大街的项目,不需要自己写,只需要把里面的代码讲解看明白就行。把其中涉及到的八股文都拿出来单独背一下,我去年找工作就一个智能小车智慧家居找了10k差不多。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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