結果

問題 No.305 鍵(2)
ユーザー 👑 H20H20
提出日時 2022-01-02 12:42:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 76,896 KB
平均クエリ数 69.77
最終ジャッジ日時 2024-04-19 18:29:31
合計ジャッジ時間 2,614 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 59 ms
70,752 KB
testcase_04 WA -
testcase_05 AC 64 ms
76,896 KB
testcase_06 AC 56 ms
70,624 KB
testcase_07 WA -
testcase_08 AC 58 ms
71,520 KB
testcase_09 WA -
testcase_10 AC 61 ms
71,264 KB
testcase_11 AC 60 ms
71,008 KB
testcase_12 AC 58 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

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().split()
    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