結果
問題 | No.24 数当てゲーム |
ユーザー | nCk_cv |
提出日時 | 2016-02-01 21:08:33 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 138 ms / 5,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 2,298 ms |
コンパイル使用メモリ | 74,704 KB |
実行使用メモリ | 57,696 KB |
最終ジャッジ日時 | 2023-10-21 18:33:23 |
合計ジャッジ時間 | 4,226 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 137 ms
57,212 KB |
testcase_01 | AC | 137 ms
57,392 KB |
testcase_02 | AC | 137 ms
57,464 KB |
testcase_03 | AC | 138 ms
57,696 KB |
testcase_04 | AC | 138 ms
57,460 KB |
testcase_05 | AC | 134 ms
57,476 KB |
testcase_06 | AC | 137 ms
57,600 KB |
testcase_07 | AC | 138 ms
57,504 KB |
testcase_08 | AC | 135 ms
57,572 KB |
testcase_09 | AC | 135 ms
57,608 KB |
ソースコード
import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int TMP = 0xffff; for(int i = 0; i < n; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); boolean ok = sc.next().equals("YES")?true:false; if(ok) TMP &= ((1 << a) | (1 << b) | (1 << c) | (1 << d)); else TMP &= ~((1 << a) | (1 << b) | (1 << c) | (1 << d)); } for(int i = 0; i < 10; i++) { if((TMP & (1 << i)) != 0) System.out.println(i); } } }