結果

問題 No.305 鍵(2)
ユーザー papinianuspapinianus
提出日時 2016-09-02 12:59:08
言語 PHP
(8.3.4)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 591 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 18,772 KB
実行使用メモリ 46,772 KB
最終ジャッジ日時 2023-09-24 00:29:30
合計ジャッジ時間 6,659 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
$digit = [0,1,2,3,4,5,6,7,8,9];
$ans = "9876543210";
$trial = array_fill(0, 10, 0);
$pos = 0;

echo implode("", $trial);
flush();
list($prev, $stat) = explode(" ", trim(fgets(STDIN)));
$trial[$pos] = ($trial[$pos] + 1) % 10;
while($stat == "locked") {
    echo implode("", $trial);
    flush();
    list($n, $stat) = explode(" ", trim(fgets(STDIN)));
    if($n > $prev) {
        $pos++;
        $prev = $n;
    } else if ($prev > $n) {
        $trial[$pos] = ($trial[$pos] + 9) % 10;
        $pos++;
    } else {
        $prev = $n;
    }
    $trial[$pos] = ($trial[$pos] + 1) % 10;
}
0