結果

問題 No.24 数当てゲーム
ユーザー scachescache
提出日時 2014-11-15 11:14:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 688 bytes
コンパイル時間 3,210 ms
コンパイル使用メモリ 72,232 KB
実行使用メモリ 57,868 KB
最終ジャッジ日時 2023-08-30 03:42:50
合計ジャッジ時間 5,303 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,060 KB
testcase_01 AC 126 ms
56,084 KB
testcase_02 AC 125 ms
57,868 KB
testcase_03 AC 126 ms
55,980 KB
testcase_04 AC 124 ms
55,444 KB
testcase_05 AC 124 ms
56,016 KB
testcase_06 AC 124 ms
55,852 KB
testcase_07 AC 125 ms
55,676 KB
testcase_08 AC 124 ms
56,000 KB
testcase_09 AC 125 ms
56,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
/**
 * yukicoder no.24
 * @author scache
 *
 */
public class InferenceNumberGame {
	public static void main(String[] args) {
		InferenceNumberGame p = new InferenceNumberGame();
	}

	public InferenceNumberGame() {
		solve();
	}

	public void solve() {
		Scanner sc = new Scanner(System.in);
		int n =sc.nextInt();
		
		int res = 0x3ff;
		for(int i=0;i<n;i++){
			int cur = 0;
			for(int j=0;j<4;j++)
				cur |= 1 << sc.nextInt();
			
			if(sc.next().equals("NO"))
				res &= 0xfff ^ cur;
			else
				res &= cur;
		}
		for(int i=0;i<=9;i++){
			if((res & (1<<i))>0){
				System.out.println(i);
				return ;
			}
		}		
	}
}
0