結果

問題 No.24 数当てゲーム
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 01:42:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 1,950 ms
コンパイル使用メモリ 74,624 KB
実行使用メモリ 54,024 KB
最終ジャッジ日時 2024-04-09 20:51:08
合計ジャッジ時間 3,709 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
52,956 KB
testcase_01 AC 106 ms
52,868 KB
testcase_02 AC 110 ms
53,664 KB
testcase_03 AC 109 ms
52,936 KB
testcase_04 AC 115 ms
53,904 KB
testcase_05 AC 110 ms
53,036 KB
testcase_06 AC 105 ms
53,020 KB
testcase_07 AC 113 ms
53,656 KB
testcase_08 AC 116 ms
54,024 KB
testcase_09 AC 104 ms
52,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int[] ints = new int[10];
		for (int i=0; i<n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			int d = sc.nextInt();
			String s = sc.next();
			if (s.equals("NO")) {
				ints[a]++;
				ints[b]++;
				ints[c]++;
				ints[d]++;
			}
			else {
				for (int j=0; j<10; j++) {
					if (j!=a && j!=b && j!=c && j!=d) {
						ints[j]++;
					}
				}
			}
		}
		
		for (int i=0; i<10; i++) {
			if (ints[i]==0) {System.out.println(i);}
		}
	}
}
0