結果

問題 No.24 数当てゲーム
ユーザー 37zigen37zigen
提出日時 2016-04-01 16:50:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 709 bytes
コンパイル時間 1,957 ms
コンパイル使用メモリ 77,748 KB
実行使用メモリ 54,332 KB
最終ジャッジ日時 2024-04-10 07:06:36
合計ジャッジ時間 3,857 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
54,128 KB
testcase_01 AC 128 ms
54,072 KB
testcase_02 AC 115 ms
52,600 KB
testcase_03 AC 125 ms
54,232 KB
testcase_04 AC 119 ms
54,028 KB
testcase_05 AC 120 ms
54,092 KB
testcase_06 AC 117 ms
54,024 KB
testcase_07 AC 122 ms
53,840 KB
testcase_08 AC 125 ms
54,332 KB
testcase_09 AC 108 ms
52,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder024;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		boolean[] table=new boolean[10];
		Arrays.fill(table, true);
		for(int i=0;i<n;i++){
			int a,b,c,d;
			a=sc.nextInt();
			b=sc.nextInt();
			c=sc.nextInt();
			d=sc.nextInt();
			String s=sc.next();
			if(s.equals("NO")){
				table[a]=false;
				table[b]=false;
				table[c]=false;
				table[d]=false;
			}else if(s.equals("YES")){
				for(int j=0;j<=9;j++){
					if(j!=a&&j!=b&&j!=c&j!=d){
						table[j]=false;
					}
				}
			}
		}
		for(int i=0;i<=9;i++){
			if(table[i]==true)System.out.println(i);
		}
	}
}
0