結果

問題 No.706 多眼生物の調査
ユーザー subsnsubsn
提出日時 2023-06-16 09:48:15
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 27,836 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 09:36:43
合計ジャッジ時間 1,115 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

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)-3]++;
    }
    for (int i = 0;i < 1000;i++) {
        if (c[i] >= max) {
            index = i + 1;
            max = c[i];
        }
    }
    printf("%d\n",index);
}
0