結果

問題 No.2768 Password Crack
ユーザー anonymouslyanonymously
提出日時 2024-05-31 22:46:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,864 KB
平均クエリ数 847.00
最終ジャッジ日時 2024-05-31 22:47:08
合計ジャッジ時間 7,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
27,336 KB
testcase_01 AC 51 ms
26,968 KB
testcase_02 AC 157 ms
27,480 KB
testcase_03 AC 56 ms
27,608 KB
testcase_04 WA -
testcase_05 AC 59 ms
27,352 KB
testcase_06 AC 80 ms
27,608 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 69 ms
27,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
N = []
S = ""
for i in range(n):
    for j in range(ord('a'), ord('z')):
        c = chr(j)
        print("? " + S + c + 'z' * (n+~i))
        N.append(int(input()))
        if N[-1] == n:
            print("! " + S + c + 'z' * (n+~i))
            exit()
        if len(N) <= 1:
            continue
        elif len(N) == 2 and N[0] > N[1]:
            S += 'a'
            break
        elif c == 'a' and N[-1] < N[-2]:
            S += 'z'
            break
        elif N[-1] > N[-2]:
            S += c
            break
    else:
        S += 'z'
print("! " + S)
0