結果

問題 No.305 鍵(2)
コンテスト
ユーザー niyarin
提出日時 2016-06-01 11:55:17
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 655 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 134 ms
コンパイル使用メモリ 77,860 KB
最終ジャッジ日時 2025-12-03 20:48:38
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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