結果
問題 |
No.24 数当てゲーム
|
ユーザー |
|
提出日時 | 2014-11-15 11:12:39 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 688 bytes |
コンパイル時間 | 4,151 ms |
コンパイル使用メモリ | 74,492 KB |
実行使用メモリ | 54,344 KB |
最終ジャッジ日時 | 2024-12-31 10:55:18 |
合計ジャッジ時間 | 6,278 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 2 |
ソースコード
import java.util.Scanner; /** * yukicoder no.24 * @author scache * */ public class InferenceNumberGame { public static void main(String[] args) { InferenceNumberGame p = new InferenceNumberGame(); } public InferenceNumberGame() { solve(); } public void solve() { Scanner sc = new Scanner(System.in); int n =sc.nextInt(); int res = 0x3fe; for(int i=0;i<n;i++){ int cur = 0; for(int j=0;j<4;j++) cur |= 1 << sc.nextInt(); if(sc.next().equals("NO")) res &= 0xfff ^ cur; else res &= cur; } for(int i=1;i<=9;i++){ if((res & (1<<i))>0){ System.out.println(i); return ; } } } }