結果

問題 No.305 鍵(2)
ユーザー convexineq
提出日時 2021-01-13 03:54:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 610 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,264 KB
実行使用メモリ 76,648 KB
平均クエリ数 92.62
最終ジャッジ日時 2024-07-17 02:56:47
合計ジャッジ時間 2,137 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def get(t):
    if DEBUG:
        return sum(ti==ai for ti,ai in zip(t,ANS)), ("unlocked" if t==ANS else "locked")
    else: return input().split()

def ask(t):
    print(t)
    sys.stdout.flush()
    a,b = get(t)
    return int(a),b

DEBUG = 0
ANS = "0100000000"
import sys
from itertools import product
ans = [-1]*10
lst = [0]*10
for i in range(10):
    cnt,ok = -1,-1
    for j in range(10):
        lst[i] = j
        x,res = ask("".join(map(str,lst)))
        if res == "unlocked": exit()
        if x > cnt:
            cnt = x
            ok = j
    ans[i] = ok
    lst[i] = 0
ask("".join(map(str,ans)))
0