結果

問題 No.24 数当てゲーム
ユーザー SuunnSuunn
提出日時 2018-11-20 05:08:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 147 ms / 5,000 ms
コード長 719 bytes
コンパイル時間 2,538 ms
コンパイル使用メモリ 74,768 KB
実行使用メモリ 41,592 KB
最終ジャッジ日時 2024-12-24 15:21:37
合計ジャッジ時間 4,847 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		Boolean[] Yes = new Boolean[10];
		
		Arrays.fill(Yes, true);
;
		for(int i=0;i<N;i++){
			int A = sc.nextInt();
			int B = sc.nextInt();
			int C = sc.nextInt();
			int D = sc.nextInt();
			String E = sc.next();
			if(E.equals("YES")){
				for(int j=0;j<10;j++){
					if(j!=A&&j!=B&&j!=C&&j!=D){
						Yes[j] = false;
					}
				}
			}else{
				Yes[A] = false;
				Yes[B] = false;
				Yes[C] = false;
				Yes[D] = false;
			}
		}
		
		for(int i=0;i<10;i++){
			if(Yes[i]){
				System.out.println(i);
			}
		}
	}
	
}
0