結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tazakky
提出日時 2017-09-11 21:38:39
言語 PHP
(843.2)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 31,272 KB
実行使用メモリ 31,436 KB
最終ジャッジ日時 2024-11-07 17:06:41
合計ジャッジ時間 2,276 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
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