結果

問題 No.548 国士無双
ユーザー nbisco
提出日時 2018-04-29 23:17:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-17 14:49:20
合計ジャッジ時間 1,362 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
hai = "abcdefghijklm"
dic = {}

count = 0
for i in hai:
    dic[i] = 0
for i in s:
    if i not in hai:
        continue
    dic[i] += 1
    count += 1

if count < 13:
    print("Impossible")
else:
    l = list(dic.values())
    if l.count(0) == 1 and l.count(1) == 11:
        for k, v in dic.items():
            if v == 0:
                print(k)
                break
    elif l.count(1) == 13:
        print("\n".join(hai))
    else:
        print("Impossible")
0