結果

問題 No.349 干支の置き物
ユーザー funakoshifunakoshi
提出日時 2019-09-02 16:22:13
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,321 bytes
コンパイル時間 1,588 ms
コンパイル使用メモリ 29,476 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-22 06:12:33
合計ジャッジ時間 2,662 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
int main(void)
{
    char str[500]="";
    int num,cnt[12]={0};
    scanf("%d",&num);
    for(int i=0;i<num;i++)
    {
        scanf("%s",str);
        if(strcmp(str,"ne")==0)
        {
            cnt[0]++;
        }
        if(strcmp(str,"ushi")==0)
        {
            cnt[1]++;
        }
        if(strcmp(str,"tora")==0)
        {
            cnt[2]++;
        }
        if(strcmp(str,"u")==0)
        {
            cnt[3]++;
        }
        if(strcmp(str,"tatsu")==0)
        {
            cnt[4]++;
        }
        if(strcmp(str,"mi")==0)
        {
            cnt[5]++;
        }
        if(strcmp(str,"uma")==0)
        {
            cnt[6]++;
        }
        if(strcmp(str,"hitsuji")==0)
        {
            cnt[7]++;
        }
        if(strcmp(str,"saru")==0)
        {
            cnt[8]++;
        }
        if(strcmp(str,"tori")==0)
        {
            cnt[9]++;
        }
        if(strcmp(str,"inu")==0)
        {
            cnt[10]++;
        }
        if(strcmp(str,"i")==0)
        {
            cnt[11]++;
        }
    }
    for(int i=0;i<12;i++)
    {
        if(cnt[i]>floor((num+1)/2))
        {
            printf("NO");
            return 0;
        }
    }
    printf("YES");
    
}
0