結果

問題 No.305 鍵(2)
ユーザー 👑 H20H20
提出日時 2022-01-02 12:41:31
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 601 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 83,680 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-04-19 18:28:50
合計ジャッジ時間 4,729 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

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 = 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