結果

問題 No.345 最小チワワ問題
ユーザー papinianuspapinianus
提出日時 2016-07-28 10:49:31
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 30,824 KB
実行使用メモリ 31,648 KB
最終ジャッジ日時 2024-04-24 10:31:10
合計ジャッジ時間 2,376 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
31,328 KB
testcase_01 AC 38 ms
31,312 KB
testcase_02 AC 39 ms
31,304 KB
testcase_03 AC 39 ms
31,352 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 38 ms
31,364 KB
testcase_08 AC 39 ms
31,316 KB
testcase_09 AC 39 ms
31,184 KB
testcase_10 AC 39 ms
31,444 KB
testcase_11 AC 39 ms
31,224 KB
testcase_12 AC 37 ms
31,172 KB
testcase_13 AC 37 ms
31,356 KB
testcase_14 WA -
testcase_15 AC 36 ms
31,532 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 36 ms
31,108 KB
testcase_20 AC 37 ms
31,128 KB
testcase_21 AC 38 ms
31,032 KB
testcase_22 AC 38 ms
31,360 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 37 ms
31,400 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 36 ms
31,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$str = trim(fgets(STDIN));
$str = preg_match_all("/c.*?w.*?w/", $str, $matches);
$min = PHP_INT_MAX;
if($str) {
    foreach($matches[0] as $match) {
        $min = min($min, strlen($match));
    }
    echo $min;
} else {
    echo -1;
}
echo PHP_EOL;
0