結果

問題 No.706 多眼生物の調査
ユーザー subsn
提出日時 2023-06-16 09:50:00
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 04:16:24
合計ジャッジ時間 864 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
int main()
{
    int c[1001];
    memset(c,0,sizeof(int)*1001);
    int n;
    int max = 0;
    int index = 0;
    scanf("%d",&n);
    char s[1024];
    for (int i = 0;i < n;i++) {
        scanf("%s", &s);
        c[strlen(s)-2]++;
    }
    for (int i = 0;i < 1000;i++) {
        if (c[i] >= max) {
            index = i;
            max = c[i];
        }
    }
    printf("%d\n",index);
}
0