結果

問題 No.24 数当てゲーム
ユーザー SuunnSuunn
提出日時 2018-11-20 05:08:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 719 bytes
コンパイル時間 2,102 ms
コンパイル使用メモリ 72,100 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-08-26 02:09:25
合計ジャッジ時間 4,297 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
56,096 KB
testcase_01 AC 103 ms
56,048 KB
testcase_02 AC 106 ms
55,760 KB
testcase_03 AC 106 ms
56,024 KB
testcase_04 AC 108 ms
56,100 KB
testcase_05 AC 116 ms
56,116 KB
testcase_06 AC 110 ms
56,008 KB
testcase_07 AC 111 ms
55,764 KB
testcase_08 AC 105 ms
55,784 KB
testcase_09 AC 108 ms
56,156 KB
権限があれば一括ダウンロードができます

ソースコード

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