結果
問題 | No.24 数当てゲーム |
ユーザー |
![]() |
提出日時 | 2018-02-26 11:34:02 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 141 ms / 5,000 ms |
コード長 | 791 bytes |
コンパイル時間 | 2,375 ms |
コンパイル使用メモリ | 74,808 KB |
実行使用メモリ | 41,812 KB |
最終ジャッジ日時 | 2024-11-22 10:14:12 |
合計ジャッジ時間 | 4,286 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char flg = 0x03FF; for (int i = 0; i < n; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); char z = 0x0000; if ("YES".equals((sc.next()))) { flg &= (z | 1 << a | 1 << b | 1 << c | 1 << d); } else { flg &= ~(z | 1 << a | 1 << b | 1 << c | 1 << d); } } for (int i = 0; i < 11; i++) { if ((flg & 1 << i) != 0) { System.out.println(i); break; } } } }