結果

問題 No.305 鍵(2)
コンテスト
ユーザー koheijkt
提出日時 2026-03-06 09:54:35
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 496 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 363 ms
コンパイル使用メモリ 85,460 KB
実行使用メモリ 73,020 KB
平均クエリ数 80.85
最終ジャッジ日時 2026-03-06 09:54:38
合計ジャッジ時間 2,691 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

ans = ['']*10
for i in range(10):
    # 0 は 9-i個並べる
    memo = ['0'] * (9 - i)
    cnt_max = 0
    max_j = -1
    for j in range(10):
        memo.append(str(j))
        print(''.join(memo + ans), flush=True)

        # 結果見る
        x, s = input().split()
        if s == 'unlocked':
            exit()
        x = int(x)
        if x > cnt_max:
            cnt_max = x
            max_j = j

        memo.pop()

    # max_j の時に正しかった
    ans[-1-i] = str(max_j)

0