結果

問題 No.486 3 Straight Win(3連勝)
ユーザー fukuseifukusei
提出日時 2017-05-10 16:24:37
言語 Java19
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 701 bytes
コンパイル時間 3,132 ms
コンパイル使用メモリ 72,240 KB
実行使用メモリ 56,444 KB
最終ジャッジ日時 2023-09-08 11:08:06
合計ジャッジ時間 7,630 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,828 KB
testcase_01 AC 117 ms
56,080 KB
testcase_02 AC 120 ms
55,792 KB
testcase_03 AC 118 ms
55,876 KB
testcase_04 AC 117 ms
56,416 KB
testcase_05 AC 115 ms
55,824 KB
testcase_06 AC 116 ms
56,000 KB
testcase_07 AC 117 ms
55,748 KB
testcase_08 AC 117 ms
56,252 KB
testcase_09 AC 117 ms
55,852 KB
testcase_10 AC 119 ms
56,220 KB
testcase_11 AC 120 ms
56,124 KB
testcase_12 AC 118 ms
55,876 KB
testcase_13 AC 117 ms
55,608 KB
testcase_14 AC 116 ms
56,008 KB
testcase_15 AC 117 ms
55,636 KB
testcase_16 AC 117 ms
55,448 KB
testcase_17 AC 118 ms
55,996 KB
testcase_18 AC 116 ms
55,884 KB
testcase_19 AC 115 ms
55,736 KB
testcase_20 AC 117 ms
56,132 KB
testcase_21 AC 117 ms
56,444 KB
testcase_22 AC 118 ms
55,920 KB
testcase_23 AC 119 ms
56,072 KB
testcase_24 AC 119 ms
55,688 KB
testcase_25 AC 117 ms
55,708 KB
testcase_26 AC 117 ms
55,804 KB
testcase_27 AC 119 ms
55,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        String[] sp = str.split("");
        boolean b = false;
        
        for(int i=0; i<sp.length-2; i++){
        	if(sp[i].equals("O") && sp[i+1].equals("O") && sp[i+2].equals("O")  ){
        		System.out.println("East");
        		b = true;
        		break;
        	}
        	else if(sp[i].equals("X") && sp[i+1].equals("X") && sp[i+2].equals("X")  ){
        		System.out.println("West");
        		b = true;
        		break;
        	}
        }
        if(b == false){
        	System.out.println("NA");
        }
    }
}
0