結果

問題 No.2768 Password Crack
ユーザー sibasyun
提出日時 2024-06-03 08:28:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 93,784 KB
平均クエリ数 1785.17
最終ジャッジ日時 2024-12-23 10:34:12
合計ジャッジ時間 7,134 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
X = "abcdefghijklmnopqrstuvwxy"
ans = ["?" for _ in range(n)]
for i in range(n):
	cnt = [0 for _ in range(25)]
	z = ["z" for _ in range(n)]
	for x in X:
		z[i] = x
		print("?", "".join(z), flush=True)
		m = int(input())
		cnt[ord(x) - ord("a")] = m
	cnts = set(cnt)
	if len(cnts) == 1:
		ans[i] = "z"
	else:
		max_cnt = max(cnt)
		idx = cnt.index(max_cnt)
		ans[i] = X[idx] 

print("!", "".join(ans), flush=True)
0