結果
| 問題 |
No.78 クジ付きアイスバー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-30 13:13:17 |
| 言語 | PHP (843.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 394 bytes |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 32,400 KB |
| 実行使用メモリ | 64,804 KB |
| 最終ジャッジ日時 | 2024-11-14 07:45:06 |
| 合計ジャッジ時間 | 140,703 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 12 TLE * 23 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
list($null, $target) = explode(" ", trim(fgets(STDIN)));
$target = gmp_init($target);
$box = str_split(trim(fgets(STDIN)));
$bought = 0;
$win = 0;
$index = 0;
while(gmp_cmp($target, 0) != 0) {
if($win) {
$win--;
} else {
$bought++;
}
$target = gmp_add($target, -1);
$win += $box[$index];
$index++;
$index %= count($box);
}
echo $bought.PHP_EOL;