結果

問題 No.88 次はどっちだ
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-26 22:57:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 1,023 bytes
コンパイル時間 3,460 ms
コンパイル使用メモリ 71,752 KB
実行使用メモリ 49,764 KB
最終ジャッジ日時 2023-10-11 14:11:22
合計ジャッジ時間 4,758 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,320 KB
testcase_01 AC 43 ms
49,128 KB
testcase_02 AC 43 ms
49,176 KB
testcase_03 AC 43 ms
49,240 KB
testcase_04 AC 43 ms
49,764 KB
testcase_05 AC 43 ms
49,052 KB
testcase_06 AC 43 ms
49,180 KB
testcase_07 AC 43 ms
49,512 KB
testcase_08 AC 43 ms
49,128 KB
testcase_09 AC 43 ms
49,124 KB
testcase_10 AC 45 ms
49,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String S = reader.readLine();
        int turn = 0;
        for (int i = 0; i < 8; i++) {
            char[] row = reader.readLine().toCharArray();
            for (int j = 0; j < 8; j++) {
                if (row[j] != '.') {
                    turn += 1;
                }
            }
        }
        if (turn % 2 == 0) {
            System.out.println(S);
        } else {
            System.out.println(anotherPlayer(S));
        }
    }

    private static String anotherPlayer(String player) {
        if (player.equals("oda")) {
            return "yukiko";
        } else {
            return "oda";
        }
    }

}
0