結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-14 08:42:18 |
| 言語 | PHP (843.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 237 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 32,272 KB |
| 実行使用メモリ | 32,532 KB |
| 最終ジャッジ日時 | 2024-07-06 03:33:43 |
| 合計ジャッジ時間 | 1,861 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 1 WA * 20 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$max = trim(fgets(STDIN));
$n = 1;
$hit = 0;
while ( $n < $max ) {
if ( ($n*2) > $max ) {
while ( ($n*2) <= $max) {
$n--;
$max--;
}
}
$n *= 2;
$hit++;
echo "hit({$hit})\tn({$n})\tmax({$max})\n";
}
echo $hit.PHP_EOL;