結果

問題 No.305 鍵(2)
ユーザー H20
提出日時 2022-01-02 12:40:31
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 608 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 83,792 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-10-11 10:38:39
合計ジャッジ時間 4,634 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import random
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x):
    s = str(x).zfill(10)
    write("%s\n" % s)
    flush()
    # ジャッジから返される値を取得
    n,l  = readline().strip()
    if l == 'unlocked':
        exit(0)
    
    return int(n)


while True:
    r = random.randint(0, 10**10-1)
    n,ans  = query(r)
    if n==0:
        break

q = [0]*10
for i in range(10):
    for j in range(10):
        q[i]=j
        x = int(''.join(map(str, q)))
        if query(x)==i+1:
            break


0