結果

問題 No.2768 Password Crack
ユーザー rlangevinrlangevin
提出日時 2024-05-31 21:47:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 94,292 KB
平均クエリ数 1785.17
最終ジャッジ日時 2024-05-31 21:47:29
合計ジャッジ時間 7,117 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,796 KB
testcase_01 AC 56 ms
69,548 KB
testcase_02 AC 198 ms
92,664 KB
testcase_03 AC 192 ms
93,372 KB
testcase_04 AC 207 ms
92,964 KB
testcase_05 AC 81 ms
70,788 KB
testcase_06 AC 212 ms
93,048 KB
testcase_07 AC 213 ms
93,364 KB
testcase_08 AC 95 ms
79,932 KB
testcase_09 AC 216 ms
93,236 KB
testcase_10 AC 226 ms
94,292 KB
testcase_11 AC 198 ms
92,600 KB
testcase_12 AC 211 ms
92,856 KB
testcase_13 AC 241 ms
93,116 KB
testcase_14 AC 216 ms
92,956 KB
testcase_15 AC 231 ms
92,676 KB
testcase_16 AC 197 ms
93,092 KB
testcase_17 AC 216 ms
93,196 KB
testcase_18 AC 212 ms
93,224 KB
testcase_19 AC 145 ms
91,492 KB
testcase_20 AC 153 ms
91,136 KB
testcase_21 AC 195 ms
92,944 KB
testcase_22 AC 169 ms
93,220 KB
testcase_23 AC 93 ms
77,828 KB
testcase_24 AC 123 ms
83,816 KB
testcase_25 AC 189 ms
93,104 KB
testcase_26 AC 119 ms
84,988 KB
testcase_27 AC 172 ms
93,112 KB
testcase_28 AC 82 ms
77,892 KB
testcase_29 AC 97 ms
79,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def query(T):
    T = "".join(T)
    print("? {}".format(T))
    return int(input())

N = int(input())
L = ["z"] * N
ans = ["! "]
for i in range(N):
    D = [0] * 25
    for j in range(25):
        L[i] = chr(j + ord("a"))
        D[j] = query(L)
    ma = max(D)
    if D.count(ma) == 1:
        ans.append(chr(ord("a") + D.index(ma)))
    else:
        ans.append("z")
    L[i] = "z"

print(*ans, sep="")
0