結果

問題 No.486 3 Straight Win(3連勝)
ユーザー YOSHIYOSHI
提出日時 2021-03-17 21:05:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 3,472 ms
コンパイル使用メモリ 74,820 KB
実行使用メモリ 50,392 KB
最終ジャッジ日時 2024-04-27 13:37:57
合計ジャッジ時間 5,964 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
50,004 KB
testcase_01 AC 54 ms
50,392 KB
testcase_02 AC 57 ms
50,376 KB
testcase_03 AC 54 ms
50,192 KB
testcase_04 AC 56 ms
50,284 KB
testcase_05 AC 54 ms
50,368 KB
testcase_06 AC 54 ms
50,304 KB
testcase_07 AC 53 ms
50,272 KB
testcase_08 AC 55 ms
50,188 KB
testcase_09 AC 56 ms
49,920 KB
testcase_10 AC 55 ms
50,032 KB
testcase_11 AC 53 ms
50,240 KB
testcase_12 AC 54 ms
49,872 KB
testcase_13 AC 53 ms
50,120 KB
testcase_14 AC 53 ms
50,356 KB
testcase_15 AC 53 ms
50,244 KB
testcase_16 AC 53 ms
50,056 KB
testcase_17 AC 53 ms
50,212 KB
testcase_18 AC 54 ms
50,004 KB
testcase_19 AC 54 ms
50,252 KB
testcase_20 AC 54 ms
50,260 KB
testcase_21 AC 53 ms
49,868 KB
testcase_22 AC 53 ms
50,184 KB
testcase_23 AC 53 ms
50,288 KB
testcase_24 AC 56 ms
50,244 KB
testcase_25 AC 55 ms
50,316 KB
testcase_26 AC 54 ms
50,364 KB
testcase_27 AC 53 ms
50,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000486_Main {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws IOException {
		String s = br.readLine();
		int oi = s.indexOf("OOO");
		int xi = s.indexOf("XXX");
		if(oi == -1 && xi == -1) {
			System.out.println("NA");
		} else if(oi == -1 || (xi != -1 && xi < oi)) {
			System.out.println("West");
		} else {
			System.out.println("East");
		}
	}
}
0