結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tazakkytazakky
提出日時 2017-09-11 21:38:39
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 971 ms
コンパイル使用メモリ 30,920 KB
実行使用メモリ 31,172 KB
最終ジャッジ日時 2024-04-25 06:53:51
合計ジャッジ時間 3,109 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,584 KB
testcase_01 AC 64 ms
30,936 KB
testcase_02 AC 41 ms
30,748 KB
testcase_03 WA -
testcase_04 AC 42 ms
30,524 KB
testcase_05 AC 40 ms
30,748 KB
testcase_06 AC 42 ms
30,944 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 41 ms
30,756 KB
testcase_10 WA -
testcase_11 AC 40 ms
30,724 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 41 ms
31,104 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 41 ms
30,908 KB
testcase_22 AC 41 ms
31,056 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 42 ms
30,768 KB
testcase_28 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    // 2 週間分の平日(xx)と休日(oo)が分かるカレンダーが与えられま
    $input = trim(fgets(STDIN));
    $input .= trim(fgets(STDIN))."x";
    
    if(strpos($input, "o") == FALSE){
        echo 0;
        exit;
    }
    //echo $input;
    $ren = 1;
    $max = 0;
    for($i = 0; $i < strlen($input); $i++){
        if($input[$i] == "o" && $input[$i + 1] == "o"){
            $ren ++;
        }elseif($input[$i] == "x"){
            if($max < $ren){
                $max = $ren;
            }
            $ren = 1;
        }
    }
    echo $max;
?>
0