結果

問題 No.349 干支の置き物
ユーザー Mcpu3Mcpu3
提出日時 2018-09-02 10:30:45
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 866 bytes
コンパイル時間 1,048 ms
コンパイル使用メモリ 29,256 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 22:17:00
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int q(const void *a,const void *b)
{
    return *(int*)b-*(int*)a;
}

int main(void)
{
    char a[8];
    int n,t[12]={0},i;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",a);
        if(strcmp(a,"ne")==0)t[0]++;
        else if(strcmp(a,"ushi")==0)t[1]++;
        else if(strcmp(a,"tora")==0)t[2]++;
        else if(strcmp(a,"u")==0)t[3]++;
        else if(strcmp(a,"tatsu")==0)t[4]++;
        else if(strcmp(a,"mi")==0)t[5]++;
        else if(strcmp(a,"uma")==0)t[6]++;
        else if(strcmp(a,"hitsuji")==0)t[7]++;
        else if(strcmp(a,"saru")==0)t[8]++;
        else if(strcmp(a,"tori")==0)t[9]++;
        else if(strcmp(a,"inu")==0)t[10]++;
        else t[11]++;
    }
    qsort(t,12,sizeof(int),q);
    puts(t[0]>(n+1)/2?"NO":"YES");
    return 0;
}
0