結果

問題 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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
68,424 KB
testcase_01 AC 103 ms
68,680 KB
testcase_02 AC 109 ms
68,424 KB
testcase_03 AC 104 ms
69,448 KB
testcase_04 AC 105 ms
68,552 KB
testcase_05 AC 102 ms
68,936 KB
testcase_06 AC 101 ms
68,680 KB
testcase_07 AC 102 ms
68,808 KB
testcase_08 AC 103 ms
68,552 KB
testcase_09 AC 102 ms
68,808 KB
testcase_10 AC 100 ms
68,168 KB
testcase_11 AC 103 ms
67,912 KB
権限があれば一括ダウンロードができます

ソースコード

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