結果

問題 No.415 ぴょん
ユーザー papinianuspapinianus
提出日時 2016-09-05 12:25:18
言語 PHP
(8.3.4)
結果
RE  
実行時間 -
コード長 306 bytes
コンパイル時間 2,325 ms
コンパイル使用メモリ 32,148 KB
実行使用メモリ 357,848 KB
最終ジャッジ日時 2024-04-27 16:37:09
合計ジャッジ時間 5,235 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
39,288 KB
testcase_01 AC 37 ms
32,148 KB
testcase_02 AC 38 ms
32,272 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($ringCnt, $step) = explode(" ", trim(fgets(STDIN)));
$ring = array_fill(0, $ringCnt, 1);
$action = 0;
$cur = 0;
$ring[$cur] = 0;
$next = ($cur+$step)%$ringCnt;
while($ring[$next]) {
    $ring[$cur] = 0;
    $cur = $next;
    $next = ($cur+$step)%$ringCnt;
    $action++;
}

echo $action.PHP_EOL;
0