結果

問題 No.486 3 Straight Win(3連勝)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-02-25 02:02:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 72,060 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-09-08 10:47:05
合計ジャッジ時間 6,982 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,612 KB
testcase_01 AC 112 ms
55,360 KB
testcase_02 AC 117 ms
55,504 KB
testcase_03 AC 118 ms
55,600 KB
testcase_04 AC 120 ms
55,640 KB
testcase_05 AC 120 ms
55,368 KB
testcase_06 AC 118 ms
55,660 KB
testcase_07 AC 119 ms
55,640 KB
testcase_08 AC 116 ms
56,280 KB
testcase_09 AC 117 ms
55,492 KB
testcase_10 AC 118 ms
55,892 KB
testcase_11 AC 120 ms
55,712 KB
testcase_12 AC 120 ms
55,608 KB
testcase_13 AC 119 ms
55,636 KB
testcase_14 AC 120 ms
55,768 KB
testcase_15 AC 116 ms
55,688 KB
testcase_16 AC 115 ms
55,472 KB
testcase_17 AC 116 ms
55,820 KB
testcase_18 AC 117 ms
55,888 KB
testcase_19 AC 117 ms
55,540 KB
testcase_20 AC 118 ms
55,540 KB
testcase_21 AC 120 ms
56,048 KB
testcase_22 AC 118 ms
56,140 KB
testcase_23 AC 118 ms
54,100 KB
testcase_24 AC 122 ms
55,692 KB
testcase_25 AC 118 ms
55,696 KB
testcase_26 AC 116 ms
55,716 KB
testcase_27 AC 119 ms
55,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        System.out.println(f(S));
    }
    static String f(String S){
        int x = S.indexOf("OOO");
        int y = S.indexOf("XXX");
        if(x==-1){
            if(y==-1){
                return "NA";
            }else{
                return "West";
            }
        }else{
            if(y==-1||x<y){
                return "East";
            }else{
                return "West";
            }
        }
    }
}
0