結果

問題 No.486 3 Straight Win(3連勝)
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 17:47:22
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 2,597 ms
コンパイル使用メモリ 71,964 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-10-11 12:20:42
合計ジャッジ時間 6,879 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 114 ms
55,564 KB
testcase_04 AC 114 ms
55,976 KB
testcase_05 AC 115 ms
55,464 KB
testcase_06 AC 114 ms
55,984 KB
testcase_07 AC 114 ms
55,716 KB
testcase_08 AC 116 ms
56,204 KB
testcase_09 AC 115 ms
55,628 KB
testcase_10 AC 118 ms
55,796 KB
testcase_11 AC 119 ms
55,592 KB
testcase_12 AC 120 ms
55,944 KB
testcase_13 AC 118 ms
55,732 KB
testcase_14 AC 119 ms
56,328 KB
testcase_15 AC 114 ms
55,600 KB
testcase_16 AC 115 ms
55,948 KB
testcase_17 AC 115 ms
56,088 KB
testcase_18 AC 114 ms
56,048 KB
testcase_19 AC 115 ms
55,692 KB
testcase_20 AC 115 ms
55,868 KB
testcase_21 AC 113 ms
55,596 KB
testcase_22 AC 116 ms
56,112 KB
testcase_23 AC 120 ms
55,948 KB
testcase_24 AC 115 ms
55,740 KB
testcase_25 AC 115 ms
55,856 KB
testcase_26 AC 116 ms
56,360 KB
testcase_27 AC 115 ms
55,872 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");
		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