結果
問題 | No.24 数当てゲーム |
ユーザー | m2543315647 |
提出日時 | 2015-05-13 12:28:08 |
言語 | Java19 (openjdk 21) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 802 bytes |
コンパイル時間 | 5,310 ms |
コンパイル使用メモリ | 72,548 KB |
実行使用メモリ | 55,692 KB |
最終ジャッジ日時 | 2023-09-20 05:11:16 |
合計ジャッジ時間 | 7,682 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 130 ms
55,420 KB |
testcase_01 | AC | 129 ms
55,692 KB |
testcase_02 | AC | 130 ms
55,592 KB |
testcase_03 | AC | 127 ms
39,748 KB |
testcase_04 | AC | 125 ms
39,368 KB |
testcase_05 | AC | 125 ms
39,692 KB |
testcase_06 | AC | 125 ms
39,720 KB |
testcase_07 | AC | 127 ms
39,724 KB |
testcase_08 | AC | 125 ms
39,744 KB |
testcase_09 | AC | 126 ms
39,292 KB |
ソースコード
import java.util.Arrays; import java.util.Scanner; public class No24 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int n = sc.nextInt(); int a, b, c, d; boolean r[] = new boolean[10]; Arrays.fill(r, true); for (int i = 0; i < n; i++) { a = sc.nextInt(); b = sc.nextInt(); c = sc.nextInt(); d = sc.nextInt(); if (sc.next().equals("YES")) { for (int j = 0; j < 10; j++) if (!(j == a || j == b || j == c || j == d)) r[j] = false; } else { r[a] = r[b] = r[c] = r[d] = false; } } for(int i=0;i<10;i++)if(r[i])System.out.println(i); } }