結果
| 問題 |
No.2925 2-Letter Shiritori
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-06-11 23:03:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 659 bytes |
| コンパイル時間 | 141 ms |
| コンパイル使用メモリ | 82,340 KB |
| 実行使用メモリ | 85,324 KB |
| 平均クエリ数 | 2.00 |
| 最終ジャッジ日時 | 2024-10-12 14:00:17 |
| 合計ジャッジ時間 | 2,589 ms |
|
ジャッジサーバーID (参考情報) |
judge / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 10 |
ソースコード
import random
random.seed(1)
alphabets = "abcdefghijklmnopqrstuvwxyz"
written = set()
alpha = input()
print(alpha * 2)
written.add(alpha * 2)
for _ in range(5):
cmd, T = input().split()
written.add(T)
print('?', T[::-1])
written.add(T[::-1])
cmd, T = input().split()
written.add(T)
print('?', T[0] + 'b')
while True:
cmd, T = input().split()
if cmd == '!':
exit()
can_write = list(set(T[1] + a for a in alphabets) - written)
if len(can_write) <= 0:
print('!')
else:
S = random.choice(can_write)
pre_char = S[1]
written.add(S)
print('?', S)