結果

問題 No.88 次はどっちだ
ユーザー yagi2yagi2
提出日時 2017-04-25 13:01:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 714 bytes
コンパイル時間 1,980 ms
コンパイル使用メモリ 73,004 KB
実行使用メモリ 56,184 KB
最終ジャッジ日時 2023-10-11 09:31:12
合計ジャッジ時間 4,080 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,968 KB
testcase_01 AC 117 ms
56,184 KB
testcase_02 AC 120 ms
56,160 KB
testcase_03 AC 120 ms
55,980 KB
testcase_04 AC 119 ms
56,132 KB
testcase_05 AC 118 ms
56,056 KB
testcase_06 AC 120 ms
55,928 KB
testcase_07 AC 120 ms
56,184 KB
testcase_08 AC 118 ms
55,820 KB
testcase_09 AC 118 ms
55,876 KB
testcase_10 AC 121 ms
56,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String first = sc.next();
        
        List<String> ban = new ArrayList<>();
        for (int i = 0; i < 8; i++) {
            ban.add(sc.next());
        }

        int k = 0;
        for (int i = 0; i < 8; i++) {
            for (String s : ban.get(i).split("")) {
                if ("w".equals(s) || "b".equals(s)) k++;
            }
        }

        if (k % 2 == 0 ^ "oda".equals(first)) {
            System.out.println("yukiko");
        } else {
            System.out.println("oda");
        }
    }
}
0