結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
23,840 KB
testcase_01 AC 41 ms
24,156 KB
testcase_02 AC 41 ms
24,272 KB
testcase_03 AC 41 ms
23,868 KB
testcase_04 AC 41 ms
24,372 KB
testcase_05 AC 42 ms
24,152 KB
testcase_06 AC 37 ms
24,132 KB
testcase_07 AC 40 ms
24,172 KB
testcase_08 AC 41 ms
24,420 KB
testcase_09 AC 40 ms
24,124 KB
testcase_10 AC 41 ms
24,064 KB
testcase_11 AC 41 ms
24,260 KB
testcase_12 AC 41 ms
23,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
key = [None] * 10
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':
            sys.exit(0)
        n = int(n)
        if best_n < n:
            best_n = n
            correct_digit = j
    key[i] = correct_digit
0