結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,560 KB
testcase_01 AC 122 ms
55,576 KB
testcase_02 WA -
testcase_03 AC 123 ms
56,272 KB
testcase_04 AC 124 ms
55,748 KB
testcase_05 AC 121 ms
55,720 KB
testcase_06 AC 121 ms
55,920 KB
testcase_07 AC 121 ms
55,544 KB
testcase_08 AC 120 ms
56,028 KB
testcase_09 AC 120 ms
56,140 KB
testcase_10 AC 122 ms
56,088 KB
testcase_11 AC 121 ms
55,704 KB
testcase_12 AC 120 ms
56,128 KB
testcase_13 AC 124 ms
53,964 KB
testcase_14 AC 122 ms
56,188 KB
testcase_15 AC 118 ms
55,792 KB
testcase_16 AC 122 ms
55,944 KB
testcase_17 AC 120 ms
57,540 KB
testcase_18 AC 120 ms
55,852 KB
testcase_19 WA -
testcase_20 AC 119 ms
55,812 KB
testcase_21 WA -
testcase_22 AC 125 ms
55,840 KB
testcase_23 AC 121 ms
55,796 KB
testcase_24 AC 120 ms
55,772 KB
testcase_25 AC 120 ms
55,856 KB
testcase_26 WA -
testcase_27 AC 121 ms
55,576 KB
testcase_28 WA -
testcase_29 AC 122 ms
55,864 KB
testcase_30 AC 121 ms
55,956 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

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