結果

問題 No.2768 Password Crack
ユーザー shimon
提出日時 2024-06-10 10:59:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 200 ms / 2,000 ms
コード長 411 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 94,728 KB
平均クエリ数 1151.63
最終ジャッジ日時 2025-01-01 22:32:45
合計ジャッジ時間 6,376 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())

def ans(a):
    print(f'! {a}')

def get(a):
    print(f'? {a}')
    k=int(input())
    return k

now=['a']*N
for i in range(N):
    first=get(''.join(now))
    for k in range(1,25):
        now[i]=chr(ord('a')+k)
        res=get(''.join(now))
        if res>first:
            break
    else:
        if first==res:
            now[i]='z'
        else:
            now[i]='a'

ans(''.join(now))
0