結果

問題 No.486 3 Straight Win(3連勝)
ユーザー tsunabittsunabit
提出日時 2018-06-30 17:53:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 5,544 ms
コンパイル使用メモリ 72,980 KB
実行使用メモリ 55,952 KB
最終ジャッジ日時 2023-09-13 16:21:56
合計ジャッジ時間 8,437 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,260 KB
testcase_01 AC 120 ms
55,472 KB
testcase_02 AC 122 ms
55,844 KB
testcase_03 AC 120 ms
55,416 KB
testcase_04 AC 120 ms
55,732 KB
testcase_05 AC 121 ms
55,796 KB
testcase_06 AC 120 ms
55,568 KB
testcase_07 AC 120 ms
55,608 KB
testcase_08 AC 120 ms
55,668 KB
testcase_09 AC 121 ms
55,672 KB
testcase_10 AC 121 ms
55,816 KB
testcase_11 AC 122 ms
55,952 KB
testcase_12 AC 122 ms
55,512 KB
testcase_13 AC 121 ms
55,240 KB
testcase_14 AC 125 ms
55,788 KB
testcase_15 AC 121 ms
55,500 KB
testcase_16 AC 121 ms
55,296 KB
testcase_17 AC 120 ms
55,796 KB
testcase_18 AC 121 ms
55,780 KB
testcase_19 AC 121 ms
55,588 KB
testcase_20 AC 122 ms
55,268 KB
testcase_21 AC 121 ms
55,496 KB
testcase_22 AC 122 ms
55,648 KB
testcase_23 AC 123 ms
55,480 KB
testcase_24 AC 123 ms
55,868 KB
testcase_25 AC 121 ms
55,560 KB
testcase_26 AC 121 ms
55,432 KB
testcase_27 AC 121 ms
55,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.Stream;

public class No486 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		char temp = 'R';
		int count = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); i++) {
			if(temp == s.charAt(i)) {
					count++;
			}else {
					temp = s.charAt(i);
					count = 1;
			}
			if(count == 3) {
					System.out.println(temp == 'O' ? "East" : "West");
					return;
			}
		}
		System.out.println("NA");

	}
}
0