結果

問題 No.486 3 Straight Win(3連勝)
ユーザー YamaKasa
提出日時 2018-05-06 17:22:07
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 1,992 ms
コンパイル使用メモリ 74,080 KB
実行使用メモリ 56,504 KB
最終ジャッジ日時 2024-06-28 02:10:10
合計ジャッジ時間 6,641 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		int cnt1 = 0;
		int cnt2 = 0;
		for(int i = 0; i < S.length(); i++) {
			char c = S.charAt(i);
			if(c == 'O') {
				cnt1 ++;
				cnt2 = 0;
			}else {
				cnt1 = 0;
				cnt2 ++;
			}
			if(cnt1 == 3) {
				System.out.println("EAST");
				System.exit(0);
			}else if(cnt2 == 3) {
				System.out.println("WEST");
				System.exit(0);
			}
		}
		System.out.println("NA");
	}
}
0