結果

問題 No.24 数当てゲーム
ユーザー kohaku_kohaku
提出日時 2016-11-11 04:13:51
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 1,027 bytes
コンパイル時間 1,913 ms
コンパイル使用メモリ 77,720 KB
実行使用メモリ 53,920 KB
最終ジャッジ日時 2024-11-25 07:40:16
合計ジャッジ時間 3,730 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

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