結果

問題 No.2925 2-Letter Shiritori
ユーザー Yuyo1984
提出日時 2024-10-12 16:47:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 443 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,632 KB
平均クエリ数 1.00
最終ジャッジ日時 2024-10-12 16:47:11
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge5 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_lowercase

used = set()
while True:
	typ = input()
	if len(typ) == 1:
		reply = typ + typ
		print(reply)
		used.add(letter)
	else:
		r, w = typ.split()
		if r == '!':
			exit()
		else:
			a, b = list(w)
			used.add(a)
			used.add(b)
			flag = False
			for c in ascii_lowercase:
				if c not in used:
					reply = b + c
					print(reply)
					used.add(c)
					Flag = True
					break
			if not(flag):
				print(b + 'a')
0