結果

問題 No.51 やる気の問題
ユーザー beatdjam
提出日時 2016-10-03 15:38:49
言語 PHP
(843.2)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 505 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 30,948 KB
実行使用メモリ 31,476 KB
最終ジャッジ日時 2024-11-21 15:17:43
合計ジャッジ時間 2,681 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$input_lines = trim(fgets(STDIN));
$input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
do {
    $tmpStr[] = $input_lines;
    $input_lines = trim(fgets(STDIN));
    $input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);
} while ($input_lines !== "");

$work = (int)$tmpStr[0];
$day = (int)$tmpStr[1];

while($day > 0){
	$todayWork = floor($work / pow($day,2));
	$work -= $todayWork;
	if($day == 1){
		echo $todayWork;
		break;
	}
	$day--;
}
// your code goes here
0