結果

問題 No.548 国士無双
コンテスト
ユーザー yumechi
提出日時 2017-10-12 23:11:46
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 419 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 129 ms
コンパイル使用メモリ 85,704 KB
実行使用メモリ 54,504 KB
最終ジャッジ日時 2026-03-27 06:04:57
合計ジャッジ時間 1,522 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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