結果

問題 No.349 干支の置き物
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-13 21:31:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 825 bytes
コンパイル時間 2,947 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 58,152 KB
最終ジャッジ日時 2023-08-17 04:23:28
合計ジャッジ時間 7,264 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,224 KB
testcase_01 AC 122 ms
55,836 KB
testcase_02 AC 123 ms
56,136 KB
testcase_03 AC 124 ms
56,024 KB
testcase_04 AC 129 ms
55,896 KB
testcase_05 AC 127 ms
56,132 KB
testcase_06 AC 129 ms
56,136 KB
testcase_07 AC 126 ms
56,000 KB
testcase_08 AC 129 ms
55,968 KB
testcase_09 AC 129 ms
55,712 KB
testcase_10 AC 126 ms
55,824 KB
testcase_11 AC 128 ms
56,068 KB
testcase_12 AC 126 ms
54,016 KB
testcase_13 AC 129 ms
55,716 KB
testcase_14 AC 128 ms
55,664 KB
testcase_15 AC 125 ms
55,956 KB
testcase_16 AC 122 ms
56,224 KB
testcase_17 AC 121 ms
58,152 KB
testcase_18 WA -
testcase_19 AC 122 ms
54,284 KB
testcase_20 WA -
testcase_21 AC 123 ms
55,724 KB
testcase_22 AC 121 ms
55,732 KB
testcase_23 WA -
testcase_24 AC 120 ms
55,800 KB
testcase_25 AC 120 ms
56,132 KB
testcase_26 AC 124 ms
56,244 KB
testcase_27 AC 127 ms
55,788 KB
testcase_28 AC 125 ms
56,152 KB
testcase_29 AC 127 ms
56,000 KB
testcase_30 WA -
testcase_31 AC 127 ms
56,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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");
    }
}
0