結果

問題 No.24 数当てゲーム
ユーザー lrf141
提出日時 2016-12-01 13:54:53
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 940 bytes
コンパイル時間 3,452 ms
コンパイル使用メモリ 74,580 KB
実行使用メモリ 41,432 KB
最終ジャッジ日時 2024-11-27 15:42:07
合計ジャッジ時間 5,395 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class no24{
    public static void main(String... args){
        
        Scanner scan = new Scanner(System.in);
        
        int n = scan.nextInt();
        int res[] = new int[10];
        int a,b,c,d,check=0;
        String flag;

        for(int i = 0; i < n; i++){
            a = scan.nextInt();
            b = scan.nextInt();
            c = scan.nextInt();
            d = scan.nextInt();

            flag = scan.next();
            if(flag.equals("YES")){
                res[a]++;
                res[b]++;
                res[c]++;
                res[d]++;
                check++;
            }else{
                res[a]--;
                res[b]--;
                res[c]--;
                res[d]--;
            }
        }

        for(int i = 0; i < 10; i++){
            if(res[i] == check){
                System.out.println(i);
                break;
            }
        }

    }
}
0