結果

問題 No.24 数当てゲーム
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-11 04:18:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 1,084 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 76,820 KB
実行使用メモリ 41,612 KB
最終ジャッジ日時 2024-05-04 01:51:06
合計ジャッジ時間 4,415 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,252 KB
testcase_01 AC 130 ms
41,112 KB
testcase_02 AC 135 ms
41,200 KB
testcase_03 AC 137 ms
41,612 KB
testcase_04 AC 131 ms
41,548 KB
testcase_05 AC 120 ms
40,220 KB
testcase_06 AC 136 ms
41,392 KB
testcase_07 AC 135 ms
41,456 KB
testcase_08 AC 132 ms
40,940 KB
testcase_09 AC 135 ms
41,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 [] a = new int [N];
        int [] b = new int [N];
        int [] c = new int [N];
        int [] d = new int [N];
        String [] arr = new String [N];
        int [] flag = new int [10];
        for(int i=0; i<N; i++){
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
            c[i] = sc.nextInt();
            d[i] = sc.nextInt();
            arr[i] = sc.next();
            if( "NO".equals(arr[i]) ){
                flag[ a[i] ]=1;
                flag[ b[i] ]=1;
                flag[ c[i] ]=1;
                flag[ d[i] ]=1;
            }else{
                for(int j=0; j<10; j++){
                    if(j!=a[i] && j!=b[i] && j!=c[i] && j!=d[i]){
                        flag[j]=1;
                    }
                }
            }
        }
        for(int i=0; i<10; i++){
            if(flag[i]==0){
                System.out.println(i);
            }
        }
    }
}
0