結果

問題 No.305 鍵(2)
ユーザー kichirb3kichirb3
提出日時 2018-03-09 12:37:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 761 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,884 KB
実行使用メモリ 24,468 KB
平均クエリ数 2.85
最終ジャッジ日時 2023-09-23 15:56:52
合計ジャッジ時間 3,617 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 37 ms
24,204 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
権限があれば一括ダウンロードができます

ソースコード

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):
    for n in numbers:
        print(n, end='')
    print('\n', 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