結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2017-10-12 21:34:59 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 135 ms / 2,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 2,297 ms |
コンパイル使用メモリ | 75,800 KB |
実行使用メモリ | 41,672 KB |
最終ジャッジ日時 | 2024-06-26 04:34:24 |
合計ジャッジ時間 | 6,748 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String s = sc.next();int east = 0; int west = 0;for(int i = 0 ; i < s.length() ; i++) {if(s.charAt(i) == 'O') {east++;west = 0;if(east == 3) {System.out.println("East");return;}} else {west++;east = 0;if(west == 3) {System.out.println("West");return;}}}System.out.println("NA");}}