結果

問題 No.587 七対子
コンテスト
ユーザー cologne
提出日時 2025-11-25 17:04:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 457 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 297 ms
コンパイル使用メモリ 82,408 KB
実行使用メモリ 55,616 KB
最終ジャッジ日時 2025-11-25 17:04:36
合計ジャッジ時間 2,959 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import Counter

import sys


def input(): return sys.stdin.readline().rstrip('\n')


def main():
    s = input()
    c = Counter(s)
    ans = None
    for k, v in c.items():
        if v == 1:
            if ans is not None:
                print('Impossible')
                return
            ans = k
        if v not in [1, 2]:
            print('Impossible')
            return
    print(ans)



if __name__ == '__main__':
    main()
0