結果
| 問題 | No.2768 Password Crack |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-31 22:01:16 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 166 ms / 2,000 ms |
| コード長 | 665 bytes |
| 記録 | |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 108,256 KB |
| 平均クエリ数 | 770.90 |
| 最終ジャッジ日時 | 2026-05-27 18:39:46 |
| 合計ジャッジ時間 | 6,255 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 29 |
ソースコード
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))