結果

問題 No.486 3 Straight Win(3連勝)
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 17:48:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 461 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 71,204 KB
実行使用メモリ 56,348 KB
最終ジャッジ日時 2023-10-11 12:20:51
合計ジャッジ時間 6,349 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,348 KB
testcase_01 AC 117 ms
55,752 KB
testcase_02 AC 116 ms
55,952 KB
testcase_03 AC 116 ms
56,320 KB
testcase_04 AC 116 ms
55,940 KB
testcase_05 AC 116 ms
55,752 KB
testcase_06 AC 116 ms
56,036 KB
testcase_07 AC 115 ms
56,136 KB
testcase_08 AC 117 ms
55,884 KB
testcase_09 AC 116 ms
55,828 KB
testcase_10 AC 118 ms
56,104 KB
testcase_11 AC 115 ms
55,500 KB
testcase_12 AC 118 ms
56,144 KB
testcase_13 AC 116 ms
56,100 KB
testcase_14 AC 114 ms
55,764 KB
testcase_15 AC 114 ms
55,980 KB
testcase_16 AC 116 ms
55,648 KB
testcase_17 AC 115 ms
56,236 KB
testcase_18 AC 114 ms
55,796 KB
testcase_19 AC 116 ms
55,776 KB
testcase_20 AC 116 ms
55,352 KB
testcase_21 AC 116 ms
55,736 KB
testcase_22 AC 117 ms
55,764 KB
testcase_23 AC 116 ms
55,956 KB
testcase_24 AC 120 ms
55,844 KB
testcase_25 AC 114 ms
55,772 KB
testcase_26 AC 116 ms
55,800 KB
testcase_27 AC 116 ms
53,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		//x=West o=East
		int w = s.indexOf("XXX");
		int o = s.indexOf("OOO");
//		System.out.println(w+":"+o);
		if (w==-1 && o==-1) System.out.println("NA");
		else if (w==-1 && o>=0) System.out.println("East");
		else if (w>=0 && o==-1) System.out.println("West");
		else System.out.println(w<o?"West":"East");
	}
}
0