結果

問題 No.88 次はどっちだ
ユーザー abcabc
提出日時 2016-11-02 13:54:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 711 bytes
コンパイル時間 1,903 ms
コンパイル使用メモリ 74,952 KB
実行使用メモリ 41,284 KB
最終ジャッジ日時 2024-05-03 21:02:23
合計ジャッジ時間 3,727 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
40,244 KB
testcase_01 AC 106 ms
39,776 KB
testcase_02 AC 117 ms
41,284 KB
testcase_03 AC 111 ms
41,000 KB
testcase_04 AC 103 ms
40,444 KB
testcase_05 AC 111 ms
40,908 KB
testcase_06 AC 103 ms
40,000 KB
testcase_07 AC 110 ms
41,272 KB
testcase_08 AC 113 ms
40,788 KB
testcase_09 AC 111 ms
40,812 KB
testcase_10 AC 113 ms
40,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String firstPlayer = sc.next();
        int discsCount = 0;

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

            String row = sc.next();

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

                if (row.charAt(j) != '.') {
                    discsCount++;
                }

            }

        }

        if (firstPlayer.equals("oda")) {

            System.out.println(discsCount % 2 == 0 ? "oda" : "yukiko");

        } else if (firstPlayer.equals("yukiko")) {

            System.out.println(discsCount % 2 == 0 ? "yukiko" : "oda");

        }

    }

}
0