結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2020-11-10 10:00:59 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 1,002 bytes |
コンパイル時間 | 2,583 ms |
コンパイル使用メモリ | 75,712 KB |
実行使用メモリ | 41,808 KB |
最終ジャッジ日時 | 2024-07-22 17:16:27 |
合計ジャッジ時間 | 4,602 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.*;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int n = sc.nextInt();boolean[] isNotTrue = new boolean[10];for (int i = 0; i < n; i++) {HashSet<Integer> used = new HashSet<>();for (int j = 0; j < 4; j++) {used.add(sc.nextInt());}if ("YES".equals(sc.next())) {for (int j = 0; j < 10; j++) {if (!used.contains(j)) {isNotTrue[j] = true;}}} else {for (int j = 0; j < 10; j++) {if (used.contains(j)) {isNotTrue[j] = true;}}}}for (int i = 0; i < 10; i++) {if (!isNotTrue[i]) {System.out.println(i);return;}}}}