結果

問題 No.24 数当てゲーム
ユーザー kou6839kou6839
提出日時 2014-11-18 15:09:22
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 957 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 74,772 KB
実行使用メモリ 55,824 KB
最終ジャッジ日時 2023-08-30 20:33:22
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,524 KB
testcase_01 AC 121 ms
55,496 KB
testcase_02 AC 122 ms
55,636 KB
testcase_03 AC 123 ms
55,592 KB
testcase_04 AC 121 ms
55,792 KB
testcase_05 AC 123 ms
55,792 KB
testcase_06 AC 122 ms
55,608 KB
testcase_07 AC 123 ms
55,824 KB
testcase_08 AC 122 ms
55,816 KB
testcase_09 AC 123 ms
55,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		ArrayList<ArrayList<Integer>> num = new ArrayList<ArrayList<Integer>>();
		ArrayList<String> ans = new ArrayList<>();
		for(int i=0;i<N;i++){
			for(int j=0;j<4;j++){
				num.add(new ArrayList<Integer>());
				num.get(i).add(sc.nextInt());
			}
			ans.add(sc.next());
		}
		for(int i=0;i<10;i++){
			boolean flagg=true;
			tt:for(int j=0;j<N;j++){
				if(ans.get(j).equals("NO")){
					for(int k=0;k<4;k++){
						if(i==num.get(j).get(k)){ 
							flagg=false;
							break tt;
							
						}
					}
				}else{
					boolean flag=true;
					for(int k=0;k<4;k++){
						if(i==num.get(j).get(k)) {
							
							flag=false;
						}
					}
					if(flag) {
						flagg=false;
						break tt;
					}
				}
			}
		if(flagg)System.out.println(i);
		
		}
	
		
	}
}
0