結果

問題 No.24 数当てゲーム
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 14:46:59
言語 Java19
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 825 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 74,060 KB
実行使用メモリ 56,464 KB
最終ジャッジ日時 2023-10-11 12:38:08
合計ジャッジ時間 4,091 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,128 KB
testcase_01 AC 124 ms
56,124 KB
testcase_02 AC 124 ms
55,608 KB
testcase_03 AC 122 ms
55,636 KB
testcase_04 AC 121 ms
56,200 KB
testcase_05 AC 121 ms
55,596 KB
testcase_06 AC 120 ms
55,544 KB
testcase_07 AC 123 ms
56,464 KB
testcase_08 AC 121 ms
55,324 KB
testcase_09 AC 123 ms
56,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {

		boolean[] num = new boolean[10];
		Arrays.fill(num, true);
		int n = sc.nextInt();
		for (int i=0; i<n; i++) {
			int[] temp = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};
			if (sc.next().equals("NO")) {
				for (int j=0; j<4; j++) {
					num[temp[j]] = false;
				}
			}
			else {
				for (int j=0; j<10; j++) {
					boolean F = true;
					for (int k=0; k<4; k++) {
						if (j == temp[k]) {
							F = false; break;
						}
					}
					if (F == true) num[j] = false;
				}
			}
			
			
//			for (int j=0; j<10; j++) {
//				System.out.print(j+":"+num[j]);
//			}
//			System.out.println();
			
		}
		
		for (int i=0; i<10; i++) {
			if (num[i] == true) System.out.println(i);
		}

	}
}
0