結果

問題 No.24 数当てゲーム
ユーザー uafr_csuafr_cs
提出日時 2015-05-10 17:15:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 818 bytes
コンパイル時間 2,245 ms
コンパイル使用メモリ 73,800 KB
実行使用メモリ 56,028 KB
最終ジャッジ日時 2023-09-19 09:45:24
合計ジャッジ時間 4,442 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,784 KB
testcase_01 AC 130 ms
55,716 KB
testcase_02 AC 132 ms
55,752 KB
testcase_03 AC 135 ms
55,756 KB
testcase_04 AC 128 ms
55,844 KB
testcase_05 AC 131 ms
55,628 KB
testcase_06 AC 130 ms
55,608 KB
testcase_07 AC 132 ms
56,028 KB
testcase_08 AC 129 ms
55,568 KB
testcase_09 AC 132 ms
55,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		final int SIZE = 10;
		
		final int N = sc.nextInt();
		
		boolean[] answer = new boolean[SIZE];
		Arrays.fill(answer, true);
		for(int i = 0; i < N; i++){
			boolean[] cur = new boolean[SIZE];
			for(int j = 0; j < 4; j++){
				cur[sc.nextInt()] = true;
			}
			
			String ret = sc.next();
			
			if("NO".equals(ret)){
				for(int j = 0; j < SIZE; j++){
					if(cur[j]){
						answer[j] = false;
					}
				}
			}else{
				for(int j = 0; j < SIZE; j++){
					if(!cur[j]){
						answer[j] = false;
					}
				}
			}
		}
		
		for(int i = 0; i < SIZE; i++){
			if(answer[i]){
				System.out.println(i);
				break;
			}
		}
		
	}
	
}
0