結果

問題 No.486 3 Straight Win(3連勝)
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-03-20 23:11:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 539 bytes
コンパイル時間 3,081 ms
コンパイル使用メモリ 71,452 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-09-08 11:04:11
合計ジャッジ時間 6,959 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,084 KB
testcase_01 AC 123 ms
55,884 KB
testcase_02 AC 124 ms
55,976 KB
testcase_03 AC 125 ms
56,032 KB
testcase_04 AC 124 ms
55,444 KB
testcase_05 AC 123 ms
56,188 KB
testcase_06 AC 122 ms
55,808 KB
testcase_07 AC 123 ms
55,508 KB
testcase_08 AC 123 ms
55,376 KB
testcase_09 AC 123 ms
55,520 KB
testcase_10 AC 126 ms
55,644 KB
testcase_11 AC 123 ms
55,972 KB
testcase_12 AC 120 ms
55,904 KB
testcase_13 AC 121 ms
55,888 KB
testcase_14 AC 123 ms
55,708 KB
testcase_15 AC 123 ms
56,132 KB
testcase_16 AC 124 ms
55,928 KB
testcase_17 AC 124 ms
55,888 KB
testcase_18 AC 122 ms
55,752 KB
testcase_19 AC 121 ms
55,544 KB
testcase_20 AC 123 ms
55,892 KB
testcase_21 AC 124 ms
55,852 KB
testcase_22 AC 121 ms
56,004 KB
testcase_23 AC 123 ms
55,984 KB
testcase_24 AC 124 ms
55,784 KB
testcase_25 AC 122 ms
55,984 KB
testcase_26 AC 122 ms
55,828 KB
testcase_27 AC 123 ms
55,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        String line = stdin.nextLine();
        
        int east = line.indexOf("OOO");
        int west = line.indexOf("XXX");
        
        String answer = (east == -1 && west == -1) ? "NA" :
                        (east == -1)  ? "West" :
                        (west == -1)  ? "East" :
                        (east < west) ? "East" : "West";
        System.out.println(answer);
    }
}
0