結果

問題 No.305 鍵(2)
ユーザー tjaketjake
提出日時 2015-12-04 01:22:30
言語 Python2
(2.7.18)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 24,372 KB
平均クエリ数 50.46
最終ジャッジ日時 2023-09-23 22:15:03
合計ジャッジ時間 1,507 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
23,532 KB
testcase_01 AC 39 ms
23,400 KB
testcase_02 AC 35 ms
24,036 KB
testcase_03 AC 39 ms
23,400 KB
testcase_04 AC 36 ms
24,264 KB
testcase_05 AC 38 ms
24,048 KB
testcase_06 AC 34 ms
23,544 KB
testcase_07 AC 37 ms
23,640 KB
testcase_08 AC 37 ms
23,628 KB
testcase_09 AC 36 ms
23,844 KB
testcase_10 AC 37 ms
24,372 KB
testcase_11 AC 37 ms
23,412 KB
testcase_12 AC 37 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin, stdout
def check(code):
    stdout.writelines(''.join(map(str, code)) + "\n")
    stdout.flush()
    s = stdin.readline().split()
    if s[1][0]=='u': exit(0)
    return int(s[0])
pw = [0]*10
f = check(pw)
i = 0
while 1:
    r = pw[i]
    pw[i] = (r+1)%10
    fn = check(pw)
    if f>fn:
        pw[i] = r
        i += 1
    else:
        f = fn
0