結果

問題 No.24 数当てゲーム
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-11 04:13:51
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,027 bytes
コンパイル時間 2,210 ms
コンパイル使用メモリ 74,536 KB
実行使用メモリ 58,064 KB
最終ジャッジ日時 2023-08-16 18:11:39
合計ジャッジ時間 3,543 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String [] arr = new String [N];
        int [] flag = new int [10];
        for(int i=0; i<N; i++){
            arr[i] = sc.nextLine();
            String [] tem = arr[i].split(" ");
            int a = Integer.parseInt(tem[0]);
            int b = Integer.parseInt(tem[1]);
            int c = Integer.parseInt(tem[2]);
            int d = Integer.parseInt(tem[3]);
            if( "NO".equals(tem[4]) ){
                flag[a]=1;
                flag[b]=1;
                flag[c]=1;
                flag[d]=1;
            }else{
                for(int j=0; j<10; j++){
                    if(j!=a && j!=b && j!=c && j!=d){
                        flag[j]=1;
                    }
                }
            }
        }
        for(int i=0; i<10; i++){
            if(flag[i]==0){
                System.out.println(i);
            }
        }
    }
}
0