結果

問題 No.305 鍵(2)
ユーザー kimiyukikimiyuki
提出日時 2016-05-31 18:19:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 575 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 24,384 KB
平均クエリ数 86.69
最終ジャッジ日時 2023-09-24 00:01:56
合計ジャッジ時間 1,682 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
24,024 KB
testcase_01 AC 42 ms
23,428 KB
testcase_02 AC 41 ms
24,360 KB
testcase_03 AC 42 ms
23,428 KB
testcase_04 AC 41 ms
24,384 KB
testcase_05 AC 42 ms
23,580 KB
testcase_06 AC 40 ms
23,988 KB
testcase_07 AC 41 ms
23,448 KB
testcase_08 AC 40 ms
24,348 KB
testcase_09 AC 40 ms
23,556 KB
testcase_10 AC 40 ms
24,252 KB
testcase_11 AC 39 ms
23,544 KB
testcase_12 AC 42 ms
23,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
key = [None] * 10
class Done(Exception):
    pass
try:
    for i in range(len(key)):
        best_n = -1
        correct_digit = None
        for j in range(10):
            key[i] = j
            print(''.join([str(c or '0') for c in key]))
            sys.stdout.flush()
            n, result = input().split()
            if result == 'unlocked':
                raise Done
            n = int(n)
            if best_n < n:
                best_n = n
                correct_digit = j
        key[i] = correct_digit
except Done:
    pass
0