結果

問題 No.548 国士無双
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2019-12-24 10:32:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 599 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 11,888 KB
実行使用メモリ 10,000 KB
最終ジャッジ日時 2023-10-21 14:39:57
合計ジャッジ時間 1,697 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,000 KB
testcase_01 AC 25 ms
10,000 KB
testcase_02 AC 25 ms
10,000 KB
testcase_03 AC 25 ms
10,000 KB
testcase_04 AC 23 ms
10,000 KB
testcase_05 AC 24 ms
10,000 KB
testcase_06 AC 23 ms
10,000 KB
testcase_07 AC 23 ms
10,000 KB
testcase_08 AC 23 ms
10,000 KB
testcase_09 AC 23 ms
10,000 KB
testcase_10 AC 23 ms
10,000 KB
testcase_11 AC 23 ms
10,000 KB
testcase_12 AC 23 ms
10,000 KB
testcase_13 AC 23 ms
10,000 KB
testcase_14 AC 23 ms
10,000 KB
testcase_15 AC 23 ms
10,000 KB
testcase_16 AC 23 ms
10,000 KB
testcase_17 AC 23 ms
10,000 KB
testcase_18 AC 23 ms
10,000 KB
testcase_19 AC 23 ms
10,000 KB
testcase_20 AC 23 ms
10,000 KB
testcase_21 AC 23 ms
10,000 KB
testcase_22 AC 23 ms
10,000 KB
testcase_23 AC 23 ms
10,000 KB
権限があれば一括ダウンロードができます

ソースコード

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