結果

問題 No.305 鍵(2)
ユーザー kichirb3kichirb3
提出日時 2018-03-09 12:42:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 736 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 24,288 KB
平均クエリ数 53.08
最終ジャッジ日時 2023-09-24 01:40:00
合計ジャッジ時間 1,632 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
23,356 KB
testcase_01 AC 33 ms
23,444 KB
testcase_02 AC 35 ms
24,204 KB
testcase_03 AC 36 ms
23,400 KB
testcase_04 AC 34 ms
23,352 KB
testcase_05 AC 35 ms
23,440 KB
testcase_06 AC 30 ms
24,288 KB
testcase_07 AC 32 ms
23,388 KB
testcase_08 AC 34 ms
23,796 KB
testcase_09 AC 33 ms
23,420 KB
testcase_10 AC 33 ms
23,544 KB
testcase_11 AC 33 ms
24,276 KB
testcase_12 AC 33 ms
23,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.305 鍵(2)
https://yukicoder.me/problems/no/305

"""
import sys
from sys import stdin
input = stdin.readline


def check_keys(numbers):
    print(''.join(map(str, numbers)), flush=True)
    res, _ = input().split()
    return int(res)


def main(args):
    numbers = [0] * 10
    prev_res = check_keys(numbers)

    for keta in range(10):
        if prev_res == 10:
            break
        for i in range(10):
            numbers[keta] = i
            res = check_keys(numbers)
            if res > prev_res:
                prev_res = res
                break
            elif res < prev_res:
                numbers[keta] -= 1
                break


if __name__ == '__main__':
    main(sys.argv[1:])
0