結果

問題 No.24 数当てゲーム
ユーザー abcabc
提出日時 2016-10-20 04:58:25
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,189 bytes
コンパイル時間 3,635 ms
コンパイル使用メモリ 77,032 KB
実行使用メモリ 41,504 KB
最終ジャッジ日時 2024-05-02 20:22:08
合計ジャッジ時間 4,332 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int NUM_TURN = sc.nextInt();

        boolean[] answer = new boolean[NUM_TURN];
        Arrays.fill(answer, true);

        for (int i = 0; i < NUM_TURN; i++) {

            int num1 = sc.nextInt();
            int num2 = sc.nextInt();
            int num3 = sc.nextInt();
            int num4 = sc.nextInt();

            String included = sc.next();

            if ("YES".equals(included)) {

                for (int j = 0; j < NUM_TURN; j++) {

                    if (!(j == num1 || j == num2 || j == num3 || j == num4)) {
                        answer[j] = false;
                    }

                }

            } else if ("NO".equals(included)) {

                answer[num1] = false;
                answer[num2] = false;
                answer[num3] = false;
                answer[num4] = false;

            }

        }

        for (int i = 0; i < NUM_TURN; i++) {

            if (answer[i]) {

                System.out.println(i);
                break;

            }

        }

    }

}
0