結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hamray
                         | 
                    
| 提出日時 | 2017-12-17 11:39:32 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 995 bytes | 
| コンパイル時間 | 559 ms | 
| コンパイル使用メモリ | 62,672 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-15 07:22:19 | 
| 合計ジャッジ時間 | 1,628 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 29 | 
ソースコード
#include<iostream>
#include<algorithm>
#include<queue>
#include <climits>
#include<string>
using namespace std;
int eto[12]; int N;
string str;
int main(){
    cin >> N;
    int maxV = 0;
    for(int i = 0; i < N; i++){
        cin >> str;
        if(str == "ne") eto[0]++;
        else if(str == "ushi") eto[1]++;
        else if(str == "tra") eto[2]++;
        else if(str == "u") eto[3]++;
        else if(str == "tatsu") eto[4]++;
        else if(str == "mi") eto[5]++;
        else if(str == "uma") eto[6]++;
        else if(str == "hitsuji") eto[7]++;
        else if(str == "saru") eto[8]++;
        else if(str == "tori") eto[9]++;
        else if(str == "inu") eto[10]++;
        else if(str == "i") eto[11]++;
    }
    for(int i = 0; i < 12; i++){
        maxV = max(maxV, eto[i]);
    }
    if(N == 1){
        cout << "YES" << endl;
    }else if(N >= 2){
        if(N - (N/2) >= maxV) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}
        
        
            
            
            
        
            
hamray