結果

問題 No.548 国士無双
ユーザー yumechi
提出日時 2017-10-12 23:11:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-05 20:31:16
合計ジャッジ時間 1,689 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    ng = "Impossible"
    d = {chr(97+i):1 for i in range(13)}
    for c in input():
        if c not in d.keys():
            print(ng)
            return
        d[c] -= 1
    if sum(d.values()) == 0:
        print("\n".join([chr(97+i) for i in range(13)]))
    else:
        ans = [i[0] for i in d.items() if i[1] > 0]
        print(ng if len(ans) >= 2 else ans[0])

if __name__=="__main__":
    solve()
0