結果
| 問題 | No.486 3 Straight Win(3連勝) |
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-02-10 14:37:16 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 549 bytes |
| 記録 | |
| コンパイル時間 | 2,042 ms |
| コンパイル使用メモリ | 74,112 KB |
| 実行使用メモリ | 55,852 KB |
| 最終ジャッジ日時 | 2024-10-13 10:59:07 |
| 合計ジャッジ時間 | 7,125 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 23 |
ソースコード
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
String s = sc.next();
int west = 0;
int east = 0;
boolean win = false;
for (int i=0; i<s.length(); i++) {
if (s.charAt(i)=='O') {west++;}
else {east++;}
if (west==3) {win = true; break;}
else if (east==3) {win = true; break;}
}
if (win==true) {
if (west==3) {System.out.println("WEST");}
else if (east==3) {System.out.println("EAST");}
}
else {
System.out.println("NA");
}
}
}
Tsukasa_Type