結果

問題 No.2768 Password Crack
ユーザー hato336
提出日時 2024-05-31 22:01:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 108,384 KB
平均クエリ数 770.90
最終ジャッジ日時 2024-12-20 23:25:36
合計ジャッジ時間 9,005 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
n = int(input())
print('?','z'*n,flush=True)
z = int(input())
if z == n:
    print('!','z'*n,flush=True)
    exit()
ans = ['' for i in range(n)]

for i in range(n):
    temp = ['z' for i in range(n)]
    for j in range(25):
        temp[i] = chr(j + ord('a'))
        print('?',''.join(temp),flush=True)
        x = int(input())
        if x == z-1:
            ans[i] = 'z'
            break
        if x == z +1:
            ans[i] = temp[i]
            break
print('!',''.join(ans))

            
    
   
0