結果

問題 No.349 干支の置き物
ユーザー monburan_0401monburan_0401
提出日時 2018-09-21 14:53:17
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 854 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 30,360 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 10:42:03
合計ジャッジ時間 1,821 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 0 ms
4,376 KB
testcase_11 AC 0 ms
4,380 KB
testcase_12 AC 0 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 0 ms
4,376 KB
testcase_15 AC 0 ms
4,376 KB
testcase_16 AC 0 ms
4,380 KB
testcase_17 AC 0 ms
4,376 KB
testcase_18 AC 0 ms
4,380 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 0 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 0 ms
4,380 KB
testcase_31 AC 0 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void){
    int N;
    char A[50][8];
    char eto[12][8] = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
    int count[12] = {0};
    int max = 0;
    //  check ok
    //  printf("%s\n",eto[10]);

    scanf("%d",&N);
    //  count
    //  compare
    for(int i = 0; i < N; i++){
        scanf("%s",A[i]);
        for(int j = 0; j < 12; j++){
            if( strcmp(A[i],eto[j]) == 0 ){
                count[j]++;
                break;
            }
        }
    }

    for(int k = 0; k < 12; k++){
        if(max < count[k]){
            max = count[k];
        }
    }

    if(N % 2 != 0){
        N = N / 2 + 1;
    }else{
        N = N / 2;
    }

    if(max > N){
        printf("NO\n");
    }else{
        printf("YES\n");
    }

    return 0;
}
0