結果

問題 No.486 3 Straight Win(3連勝)
ユーザー jimanojimano
提出日時 2018-01-19 00:06:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 5,439 ms
コンパイル使用メモリ 72,724 KB
実行使用メモリ 56,044 KB
最終ジャッジ日時 2023-09-08 11:19:36
合計ジャッジ時間 9,198 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,512 KB
testcase_01 AC 121 ms
55,324 KB
testcase_02 AC 119 ms
55,252 KB
testcase_03 AC 124 ms
55,748 KB
testcase_04 AC 120 ms
55,788 KB
testcase_05 AC 120 ms
55,328 KB
testcase_06 AC 118 ms
55,736 KB
testcase_07 AC 119 ms
55,616 KB
testcase_08 AC 119 ms
55,704 KB
testcase_09 AC 119 ms
55,648 KB
testcase_10 AC 121 ms
55,628 KB
testcase_11 AC 122 ms
55,924 KB
testcase_12 AC 119 ms
56,044 KB
testcase_13 AC 124 ms
55,600 KB
testcase_14 AC 123 ms
55,616 KB
testcase_15 AC 121 ms
55,684 KB
testcase_16 AC 118 ms
55,484 KB
testcase_17 AC 119 ms
55,776 KB
testcase_18 AC 118 ms
55,480 KB
testcase_19 AC 119 ms
55,552 KB
testcase_20 AC 120 ms
55,404 KB
testcase_21 AC 120 ms
55,548 KB
testcase_22 AC 119 ms
55,944 KB
testcase_23 AC 119 ms
55,500 KB
testcase_24 AC 120 ms
55,952 KB
testcase_25 AC 119 ms
55,776 KB
testcase_26 AC 121 ms
55,428 KB
testcase_27 AC 118 ms
55,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.util.Scanner;

public class No0486 {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String S = sc.next();
			int o = S.indexOf("OOO");
			int x = S.indexOf("XXX");

			if (x == -1 && o != -1) {
				System.out.println("East");
			} else if (o == -1 && x != -1) {
				System.out.println("West");
			} else if (o < x) {
				System.out.println("East");
			} else if (x < o) {
				System.out.println("West");
			} else {
				System.out.println("NA");
			}
		}
	}
}
0