結果
問題 |
No.341 沈黙の期間
|
ユーザー |
|
提出日時 | 2016-07-28 09:27:33 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 43 ms / 5,000 ms |
コード長 | 524 bytes |
コンパイル時間 | 239 ms |
コンパイル使用メモリ | 32,020 KB |
実行使用メモリ | 32,656 KB |
最終ジャッジ日時 | 2024-11-06 18:06:27 |
合計ジャッジ時間 | 1,464 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php $str = preg_split("//u", trim(fgets(STDIN))); $len = count($str); $start = false; $max = 0; $cnt = 0; for($i = 0; $i < $len; $i++) { if($str[$i]=="…") { if(!$start) { $start = true; $cnt = 1; } else { $cnt++; } } else { if($start) { $max = max($max, $cnt); $start = false; $cnt = 0; } } } if($start) { $max = max($max, $cnt); $start = false; $cnt = 0; } echo $max; echo PHP_EOL;