結果

問題 No.486 3 Straight Win(3連勝)
ユーザー ガヴリールガヴリール
提出日時 2017-03-16 02:34:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 508 bytes
コンパイル時間 3,389 ms
コンパイル使用メモリ 71,320 KB
実行使用メモリ 56,316 KB
最終ジャッジ日時 2023-09-08 11:01:14
合計ジャッジ時間 8,084 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,352 KB
testcase_01 AC 121 ms
55,568 KB
testcase_02 AC 121 ms
55,660 KB
testcase_03 AC 121 ms
55,508 KB
testcase_04 AC 120 ms
56,024 KB
testcase_05 AC 121 ms
55,904 KB
testcase_06 AC 119 ms
55,744 KB
testcase_07 AC 121 ms
55,436 KB
testcase_08 AC 120 ms
56,316 KB
testcase_09 AC 121 ms
55,756 KB
testcase_10 AC 120 ms
55,772 KB
testcase_11 AC 121 ms
55,744 KB
testcase_12 AC 121 ms
55,932 KB
testcase_13 AC 120 ms
55,700 KB
testcase_14 AC 121 ms
55,800 KB
testcase_15 AC 120 ms
55,612 KB
testcase_16 AC 121 ms
55,688 KB
testcase_17 AC 120 ms
55,460 KB
testcase_18 AC 120 ms
55,652 KB
testcase_19 AC 120 ms
56,036 KB
testcase_20 AC 120 ms
55,632 KB
testcase_21 AC 121 ms
55,444 KB
testcase_22 AC 123 ms
55,724 KB
testcase_23 AC 122 ms
55,916 KB
testcase_24 AC 121 ms
56,120 KB
testcase_25 AC 121 ms
55,608 KB
testcase_26 AC 120 ms
55,584 KB
testcase_27 AC 121 ms
55,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No_486 {
	public static void main(String[] args){
		String Str;
		int West=0,East=0;
		Scanner scanner = new Scanner(System.in);
		Str  = scanner.next();
		scanner.close();
		for(int i=0;i<Str.length();i++){ 
			if(Str.charAt(i) == 'O'){
				East=0;
				West++;
				if(West>=3){ System.out.println("East"); return;}
			}
			if(Str.charAt(i)=='X'){
				West=0;
				East++;
				if(East>=3){ System.out.println("West"); return;}
			}
		}
		System.out.println("NA");
	}
}
0