結果

問題 No.2925 2-Letter Shiritori
ユーザー loop0919loop0919
提出日時 2024-06-11 23:04:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 71,368 KB
平均クエリ数 7.00
最終ジャッジ日時 2024-10-12 14:00:20
合計ジャッジ時間 2,405 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0