結果

問題 No.305 鍵(2)
ユーザー niyarinniyarin
提出日時 2016-06-01 11:55:17
言語 Python2
(2.7.18)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 24,324 KB
平均クエリ数 44.00
最終ジャッジ日時 2023-09-24 00:02:32
合計ジャッジ時間 1,540 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
24,252 KB
testcase_01 AC 34 ms
23,664 KB
testcase_02 AC 34 ms
24,036 KB
testcase_03 AC 34 ms
24,324 KB
testcase_04 AC 33 ms
24,264 KB
testcase_05 AC 35 ms
23,856 KB
testcase_06 AC 33 ms
24,036 KB
testcase_07 AC 34 ms
23,388 KB
testcase_08 AC 36 ms
23,388 KB
testcase_09 AC 35 ms
23,376 KB
testcase_10 AC 35 ms
24,060 KB
testcase_11 AC 35 ms
23,400 KB
testcase_12 AC 35 ms
23,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
l = list("0000000000")
while True:
    print "".join(l)
    sys.stdout.flush()
    x,state = raw_input().split(" ")
    x = int(x)
    if (state == "unlocked"):
        break

    new_l = []
    for i in range(10):
        _l = [] + l
        _l[i] = str((int(l[i]) + 1 ) % 10)
        print "".join(_l)
        sys.stdout.flush()
        y,state = raw_input().split(" ")
        if (state == "unlocked"):
            exit()
        y = int(y)
        if (x == y ):
            new_l.append(str((int(_l[i]) + 1 ) % 10 ))
        elif (x < y ):
            new_l.append(_l[i])
        else:
            new_l.append(l[i])
    l = new_l
        
0