結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,836 KB
testcase_01 AC 123 ms
55,680 KB
testcase_02 AC 124 ms
55,832 KB
testcase_03 AC 125 ms
55,808 KB
testcase_04 AC 123 ms
55,608 KB
testcase_05 WA -
testcase_06 AC 122 ms
55,896 KB
testcase_07 AC 123 ms
55,812 KB
testcase_08 AC 120 ms
55,688 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = 0x3fe;
		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=1;i<=9;i++){
			if((res & (1<<i))>0){
				System.out.println(i);
				return ;
			}
		}		
	}
}
0