結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             funakoshi
                         | 
                    
| 提出日時 | 2019-09-02 16:22:13 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 1 ms / 2,000 ms | 
| コード長 | 1,321 bytes | 
| コンパイル時間 | 407 ms | 
| コンパイル使用メモリ | 31,488 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-16 01:04:51 | 
| 合計ジャッジ時間 | 1,427 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
#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");
    
}
            
            
            
        
            
funakoshi