結果

問題 No.486 3 Straight Win(3連勝)
ユーザー tazakkytazakky
提出日時 2017-09-21 11:05:56
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 1,336 ms
コンパイル使用メモリ 18,680 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2023-09-08 11:14:21
合計ジャッジ時間 2,806 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,968 KB
testcase_01 AC 15 ms
18,912 KB
testcase_02 AC 15 ms
18,732 KB
testcase_03 AC 15 ms
18,988 KB
testcase_04 AC 15 ms
18,976 KB
testcase_05 AC 16 ms
18,912 KB
testcase_06 AC 15 ms
18,904 KB
testcase_07 AC 15 ms
18,984 KB
testcase_08 AC 16 ms
18,876 KB
testcase_09 AC 15 ms
18,944 KB
testcase_10 AC 15 ms
18,728 KB
testcase_11 AC 15 ms
18,920 KB
testcase_12 AC 15 ms
18,740 KB
testcase_13 AC 15 ms
18,908 KB
testcase_14 AC 16 ms
18,780 KB
testcase_15 AC 15 ms
18,728 KB
testcase_16 AC 15 ms
19,072 KB
testcase_17 AC 15 ms
18,908 KB
testcase_18 AC 15 ms
18,728 KB
testcase_19 AC 15 ms
18,976 KB
testcase_20 AC 15 ms
18,976 KB
testcase_21 AC 15 ms
18,912 KB
testcase_22 AC 15 ms
18,868 KB
testcase_23 AC 15 ms
18,908 KB
testcase_24 AC 15 ms
18,868 KB
testcase_25 AC 15 ms
18,916 KB
testcase_26 AC 16 ms
18,932 KB
testcase_27 AC 16 ms
18,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $s = str_split(trim(fgets(STDIN)));
    //print_r($s);
    $win = 0;
    $lose = 0;
    for($i = 0; $i < count($s); $i++){
        if($s[$i] == "O"){
            $win++;
            $lose = 0;
        }else{
            $lose++;
            $win = 0;
        }
        if($win == 3){
            echo "East";
            break;
        }elseif($lose == 3){
            echo "West";
             break;
        }
    }
    if($win < 3 && $lose < 3){
        echo "NA";
    }
?>
0