結果

問題 No.2768 Password Crack
ユーザー rin204rin204
提出日時 2024-05-31 21:38:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,712 KB
実行使用メモリ 93,992 KB
平均クエリ数 1785.17
最終ジャッジ日時 2024-05-31 21:38:44
合計ジャッジ時間 7,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
68,760 KB
testcase_01 AC 62 ms
68,924 KB
testcase_02 AC 216 ms
93,048 KB
testcase_03 AC 210 ms
93,212 KB
testcase_04 AC 211 ms
93,376 KB
testcase_05 AC 95 ms
76,136 KB
testcase_06 AC 212 ms
93,472 KB
testcase_07 AC 209 ms
93,120 KB
testcase_08 AC 107 ms
82,388 KB
testcase_09 AC 210 ms
92,896 KB
testcase_10 AC 209 ms
92,972 KB
testcase_11 AC 211 ms
93,364 KB
testcase_12 AC 209 ms
93,372 KB
testcase_13 AC 210 ms
93,208 KB
testcase_14 AC 210 ms
93,428 KB
testcase_15 AC 210 ms
93,404 KB
testcase_16 AC 206 ms
93,116 KB
testcase_17 AC 213 ms
93,484 KB
testcase_18 AC 229 ms
93,072 KB
testcase_19 AC 158 ms
93,308 KB
testcase_20 AC 157 ms
93,992 KB
testcase_21 AC 206 ms
93,168 KB
testcase_22 AC 188 ms
93,156 KB
testcase_23 AC 92 ms
79,168 KB
testcase_24 AC 180 ms
87,260 KB
testcase_25 AC 208 ms
93,620 KB
testcase_26 AC 136 ms
88,096 KB
testcase_27 AC 190 ms
93,264 KB
testcase_28 AC 93 ms
78,528 KB
testcase_29 AC 110 ms
81,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = ["a"] * n
for i in range(1, n + 1):
    mi = 1 << 30
    ma = -1
    ss = "z"
    for j in range(25):
        s = chr(97 + j)
        S[i - 1] = s
        print("?", "".join(S), flush=True)
        res = int(input())
        mi = min(mi, res)
        if res > ma:
            ma = max(ma, res)
            ss = s

    if mi == ma:
        ss = "z"
    S[i - 1] = ss

print("!", "".join(S))
0