結果

問題 No.548 国士無双
ユーザー _KingdomOfMoray
提出日時 2019-12-24 10:32:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 599 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-21 15:54:32
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

s = input()

clc_s = collections.Counter(list(s))
key_list = list(clc_s.keys())
value_list = list(clc_s.values())

count1 = value_list.count(1)
count2 = value_list.count(2)

res = []
if count1 == 13 or (count1 == 11 and count2 == 1):
    if count1 == 13:
        for i in range(13):
            res.append(chr(ord('a') + i))
    else:
        for i in range(13):
            cur_char = chr(ord('a') + i)
            if key_list.count(cur_char) == 0:
                res.append(cur_char)
else:
    res.append('Impossible')
    
for i in range(len(res)):
    print(res[i])
        
0