結果

問題 No.706 多眼生物の調査
ユーザー hum_ophum_op
提出日時 2018-07-10 23:11:43
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 25,428 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-12 00:23:42
合計ジャッジ時間 1,017 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(){
    int N;
    int a[1001] = {0};
    int i, j, c;
    char S[1000];
    
    scanf("%d", &N);
    
    for(i = 0; i < N; i++){
        scanf("%s", S);
        for(j = 0, c = 0; S[j] != '\0'; j++){
            if(S[j] == '^') c++;
        }
        a[c]++;
    }
    
    j = a[0];
    c = 0;
    for(i = 1; i < 1001; i++){
        if(j <= a[i]){
            j = a[i];
            c = i;
         }
     }
     printf("%d\n", c);
     return 0;
}
0