結果

問題 No.548 国士無双
ユーザー fiord
提出日時 2017-07-28 23:15:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-17 13:30:39
合計ジャッジ時間 1,674 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
s = input()
cnt = [0] * 13
for i in s:
    if ord(i) > ord('m') or ord(i) < ord('a'):
        print("Impossible")
        sys.exit(0)
    else:
        cnt[ord(i) - ord('a')] += 1
cntzero = 0
for i in range(13):
    cntzero += 1 if cnt[i] == 0 else 0
if cntzero >= 2:
    print("Impossible")
elif cntzero == 1:
    for i in range(13):
        if cnt[i] == 0:
            print(chr(i + ord('a')))
else:
    for i in range(13):
        print(chr(i + ord('a')))
0