結果

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

ソースコード

diff #

from string import ascii_lowercase
a = ascii_lowercase
from collections import defaultdict
mp = defaultdict(list)
for s in a:
    for t in a:
        mp[s].append(s+t)

alpha = input()

while True:
    for candidate in mp[alpha]:
        tail = candidate[1]
        if len(mp[tail]):
            print('?',mp[alpha].pop())
            break
    res = input()
    if res == '! WIN':
        exit()        
    content = res.split()[1]
    alpha = content[1]
    
0