結果

問題 No.2925 2-Letter Shiritori
ユーザー 👑 loop0919loop0919
提出日時 2024-06-12 01:29:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 69,448 KB
平均クエリ数 26.00
最終ジャッジ日時 2024-10-12 14:00:24
合計ジャッジ時間 2,446 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

written = set()

alpha = input()
assert ord('a') <= ord(alpha) <= ord('z')

pre = alpha

while True:
	S = pre + alpha
	print('?', S, flush=True)
	written.add(S)
	
	cmd, T = input().split()
	
	if cmd == '?':
		assert len(T) == 2
		assert all(ord('a') <= ord(t) <= ord('z') for t in T)
		assert T not in written
		assert S[1] == T[0]
		
		pre = T[1]
	
	if cmd == '!':
		exit()
0