結果

問題 No.203 ゴールデン・ウィーク(1)
ユーザー tazakkytazakky
提出日時 2017-09-11 21:39:55
言語 PHP
(8.3.4)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 579 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 32,272 KB
実行使用メモリ 31,436 KB
最終ジャッジ日時 2024-04-29 08:25:56
合計ジャッジ時間 1,965 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
31,224 KB
testcase_01 AC 41 ms
31,408 KB
testcase_02 AC 35 ms
31,340 KB
testcase_03 AC 34 ms
30,676 KB
testcase_04 AC 32 ms
31,272 KB
testcase_05 AC 34 ms
31,316 KB
testcase_06 AC 32 ms
30,844 KB
testcase_07 AC 32 ms
30,836 KB
testcase_08 AC 32 ms
31,296 KB
testcase_09 AC 31 ms
30,944 KB
testcase_10 AC 32 ms
30,880 KB
testcase_11 AC 33 ms
31,388 KB
testcase_12 AC 33 ms
30,760 KB
testcase_13 AC 33 ms
31,224 KB
testcase_14 AC 34 ms
30,800 KB
testcase_15 AC 34 ms
30,996 KB
testcase_16 AC 32 ms
30,868 KB
testcase_17 AC 33 ms
31,436 KB
testcase_18 AC 34 ms
31,052 KB
testcase_19 AC 33 ms
31,120 KB
testcase_20 AC 31 ms
30,768 KB
testcase_21 AC 31 ms
31,056 KB
testcase_22 AC 31 ms
31,180 KB
testcase_23 AC 32 ms
30,784 KB
testcase_24 AC 33 ms
31,196 KB
testcase_25 AC 32 ms
30,984 KB
testcase_26 AC 34 ms
31,344 KB
testcase_27 AC 32 ms
30,976 KB
testcase_28 AC 32 ms
31,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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