結果

問題 No.486 3 Straight Win(3連勝)
ユーザー fal_rndfal_rnd
提出日時 2017-02-28 23:30:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 3,470 ms
コンパイル使用メモリ 71,904 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-09-08 10:53:50
合計ジャッジ時間 8,067 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,640 KB
testcase_01 AC 119 ms
55,704 KB
testcase_02 AC 117 ms
55,516 KB
testcase_03 AC 117 ms
55,452 KB
testcase_04 AC 118 ms
55,592 KB
testcase_05 AC 118 ms
55,548 KB
testcase_06 AC 118 ms
55,748 KB
testcase_07 AC 120 ms
55,576 KB
testcase_08 AC 120 ms
55,852 KB
testcase_09 AC 120 ms
55,936 KB
testcase_10 AC 120 ms
55,720 KB
testcase_11 AC 119 ms
55,792 KB
testcase_12 AC 123 ms
56,188 KB
testcase_13 AC 118 ms
55,788 KB
testcase_14 AC 117 ms
55,516 KB
testcase_15 AC 119 ms
56,012 KB
testcase_16 AC 119 ms
55,684 KB
testcase_17 AC 120 ms
56,028 KB
testcase_18 AC 118 ms
56,032 KB
testcase_19 AC 118 ms
55,844 KB
testcase_20 AC 118 ms
55,616 KB
testcase_21 AC 117 ms
55,816 KB
testcase_22 AC 118 ms
55,852 KB
testcase_23 AC 119 ms
55,768 KB
testcase_24 AC 119 ms
55,776 KB
testcase_25 AC 118 ms
56,100 KB
testcase_26 AC 119 ms
55,920 KB
testcase_27 AC 118 ms
56,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class A{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		char in[] =
				s.next()
				.replaceFirst("OOO", "1")
				.replaceFirst("XXX", "2")
				.toCharArray();

		for(char c:in) {
			switch(c) {
			case '1':
				System.out.println("East");
				return;
			case '2':
				System.out.println("West");
				return;
			}
		}
		System.out.println("NA");
	}
}
0