/ 科创班 /

记录详情

Accepted


  
# 状态 耗时 内存占用
#1 Accepted 5ms 256.0 KiB
#2 Accepted 3ms 256.0 KiB
#3 Accepted 2ms 256.0 KiB
#4 Accepted 2ms 256.0 KiB
#5 Accepted 2ms 256.0 KiB

代码

#include <stdio.h>

int main()
{
    int i, j, k, l, n, a[20][20], b[20] = {0}, c[20] = {0};
    scanf("%d", &n);
    for (i = 0; i < n; i++)
        for (j = 0; j < n; j++)
            scanf("%d", &a[i][j]);
    l = 1;
    for (i = 0; i < n; i++)
    {
        if (b[i] != 0)
            continue;
        b[i] = l++;
        for (j = i + 1; j < n; j++)
        {
            if (b[j] != 0)
                continue;
            for (k = 0; k < n; k++)
                if (a[i][k] != a[j][k])
                    break;
            if (k == n)
                b[j] = b[i];
        }
    }
            
    int max = 0;
    for (i = 0; i < n; i++)
        c[b[i]]++;
    for (i = 0; i < l; i++)
        if (c[max] < c[i])
            max = i;
    for (i = 0; i < n; i++)
        if (max == b[i])
            printf("%d ", i + 1);  
     
    return 0;
}

信息

递交者
类型
递交
题目
芯片测试 c
题目数据
下载
语言
C
递交时间
2018-10-20 16:05:01
评测时间
2018-10-20 16:05:01
评测机
分数
100
总耗时
17ms
峰值内存
256.0 KiB