結果

問題 No.24 数当てゲーム
ユーザー skylineskyline
提出日時 2020-02-02 16:31:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,475 bytes
コンパイル時間 2,302 ms
コンパイル使用メモリ 79,276 KB
実行使用メモリ 57,800 KB
最終ジャッジ日時 2023-10-19 01:17:06
合計ジャッジ時間 4,420 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

class Main {
    
    public static void main(String[] args) {
        
        No0021 no = new No0021();

        System.out.println(no.result());
        
    }
    
}

class No0021 {
    public final int MAX_NUM = 9;
    public final int COL_NUM = 4;
    public final String STR_YES = "YES";
    public final String STR_NO = "NO";
    private int n;
    private List<Boolean> boolList;
    private String result;

    public No0021() {
        Scanner sc = new Scanner(System.in);
        this.n = sc.nextInt();
        this.boolList = new ArrayList<>(MAX_NUM);
        for (int i = 0; i < MAX_NUM; i++) {
            this.boolList.add(true);
        }
        for (int i = 0; i < this.n; i++) {
            List<Integer> valList = new ArrayList<>(COL_NUM);
            for (int j = 0; j < COL_NUM; j++) {
                valList.add(sc.nextInt());
            }
            String ret = sc.next();
            if (STR_NO.equals(ret)) {
                for (Integer val : valList) {
                    if (!boolList.get(val)) {
                        this.boolList.set(val, false);
                    }
                }
            }
        }
        for (int i = 0; i < this.boolList.size(); i++) {
            if (this.boolList.get(i)) {
                this.result = String.valueOf(i);
            }
        }
    }
    
    public String result() {
        return this.result;
    }
}
0