結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kohaku_kohaku
                         | 
                    
| 提出日時 | 2016-11-13 21:31:44 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 825 bytes | 
| コンパイル時間 | 1,981 ms | 
| コンパイル使用メモリ | 80,684 KB | 
| 実行使用メモリ | 54,496 KB | 
| 最終ジャッジ日時 | 2024-11-25 21:58:46 | 
| 合計ジャッジ時間 | 6,958 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 WA * 4 | 
ソースコード
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int h = (N+1)/2;
        String [] E = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
        String [] A = new String [N];
        int [] B = new int [12];
        int max = 0;
        for(int i=0; i<N; i++){
            A[i] = sc.next();
            for(int j=0; j<12; j++){
                if( E[j].equals(A[i]) ){
                    B[j]++;
                    max = Math.max(max, B[j]);
                    break;
                }
                if(max>=h){
                    System.out.println("NO");
                    return;
                }
            }
        }
        System.out.println("YES");
    }
}
            
            
            
        
            
kohaku_kohaku