結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
57,500 KB
testcase_01 WA -
testcase_02 AC 134 ms
57,492 KB
testcase_03 AC 136 ms
57,364 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 133 ms
57,124 KB
testcase_07 AC 135 ms
57,348 KB
testcase_08 AC 123 ms
56,160 KB
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