結果

問題 No.587 七対子
ユーザー brthyyjpbrthyyjp
提出日時 2020-07-07 04:05:59
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 71,828 KB
最終ジャッジ日時 2023-09-27 02:48:21
合計ジャッジ時間 5,106 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
71,780 KB
testcase_01 AC 99 ms
71,504 KB
testcase_02 AC 94 ms
71,768 KB
testcase_03 AC 97 ms
71,616 KB
testcase_04 AC 94 ms
71,292 KB
testcase_05 AC 91 ms
71,416 KB
testcase_06 AC 93 ms
71,712 KB
testcase_07 AC 93 ms
71,284 KB
testcase_08 AC 92 ms
71,396 KB
testcase_09 AC 93 ms
71,544 KB
testcase_10 AC 95 ms
71,636 KB
testcase_11 AC 96 ms
71,636 KB
testcase_12 AC 94 ms
71,616 KB
testcase_13 AC 93 ms
71,624 KB
testcase_14 AC 95 ms
71,416 KB
testcase_15 AC 92 ms
71,572 KB
testcase_16 AC 95 ms
71,436 KB
testcase_17 AC 92 ms
71,724 KB
testcase_18 AC 94 ms
71,576 KB
testcase_19 AC 96 ms
71,816 KB
testcase_20 AC 94 ms
71,504 KB
testcase_21 AC 94 ms
71,828 KB
testcase_22 AC 97 ms
71,576 KB
testcase_23 AC 97 ms
71,544 KB
testcase_24 AC 96 ms
71,492 KB
testcase_25 AC 97 ms
71,420 KB
testcase_26 AC 99 ms
71,424 KB
testcase_27 AC 100 ms
71,788 KB
testcase_28 AC 96 ms
71,724 KB
testcase_29 AC 96 ms
71,592 KB
testcase_30 AC 95 ms
71,788 KB
testcase_31 AC 93 ms
71,804 KB
testcase_32 AC 96 ms
71,776 KB
testcase_33 AC 94 ms
71,628 KB
testcase_34 AC 95 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = list(str(input()))
from collections import Counter
C = Counter(s)
D = list(C.items())
D.sort(key=lambda x: x[1])
if len(D) != 7:
    print('Impossible')
    exit()

for i in range(7):
    k, v = D[i]
    if i == 0:
        if v != 1:
            print('Impossible')
            exit()
        else:
            ans = k
    else:
        if v != 2:
            print('Impossible')
            exit()
else:
    print(ans)
0