結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー dong_fengdong_feng
提出日時 2018-04-30 02:02:04
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 18,728 KB
実行使用メモリ 37,528 KB
最終ジャッジ日時 2023-09-10 08:17:12
合計ジャッジ時間 5,984 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 14 ms
18,832 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

function countSafeBoxex($trapInput, $mouseCount){
	$safeCount = 0;
	for($i=$mouseCount;$i<strlen($trapInput);$i++){
		if($trapInput[$i]=='o') $safeCount ++;
	}
	return $safeCount;
}

//ここから
$trapInput=fgets(STDIN);

$trapInput = str_replace(array('\n','\r',PHP_EOL),"",$trapInput);

for($i=0;$i<strlen($trapInput);$i++){
	printf("%.7f",countSafeBoxex($trapInput, $i)/(strlen($trapInput)-$i));
	echo PHP_EOL;
}
0