結果

問題 No.88 次はどっちだ
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-25 22:50:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 565 bytes
コンパイル時間 2,340 ms
コンパイル使用メモリ 74,480 KB
実行使用メモリ 57,648 KB
最終ジャッジ日時 2023-10-23 20:07:24
合計ジャッジ時間 4,165 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
57,536 KB
testcase_01 AC 114 ms
56,172 KB
testcase_02 AC 123 ms
57,520 KB
testcase_03 AC 120 ms
57,280 KB
testcase_04 AC 122 ms
57,428 KB
testcase_05 AC 123 ms
57,648 KB
testcase_06 AC 111 ms
56,180 KB
testcase_07 AC 126 ms
57,644 KB
testcase_08 AC 122 ms
57,168 KB
testcase_09 AC 120 ms
57,344 KB
testcase_10 AC 121 ms
55,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        String[] name = {"oda", "yukiko"};
        int stones = 0;
        for(int i=0; i<8; i++) {
            String l = in.next();
            for(int j=0; j<8; j++) {
                if(l.charAt(j) != '.') {
                    stones++;
                }
            }
        }
        int turn = s.equals(name[0]) ? 0 : 1;
        System.out.println(name[(turn+stones)%2]);
    }
}
0