結果

問題 No.587 七対子
ユーザー mlihua09mlihua09
提出日時 2020-08-29 14:39:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 462 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 71,864 KB
最終ジャッジ日時 2023-09-27 02:52:25
合計ジャッジ時間 5,291 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
71,796 KB
testcase_01 AC 99 ms
71,856 KB
testcase_02 AC 98 ms
71,672 KB
testcase_03 AC 99 ms
71,580 KB
testcase_04 AC 100 ms
71,500 KB
testcase_05 AC 99 ms
71,772 KB
testcase_06 AC 99 ms
71,304 KB
testcase_07 AC 101 ms
71,420 KB
testcase_08 AC 103 ms
71,768 KB
testcase_09 AC 102 ms
71,540 KB
testcase_10 AC 98 ms
71,584 KB
testcase_11 AC 99 ms
71,568 KB
testcase_12 AC 99 ms
71,652 KB
testcase_13 AC 99 ms
71,568 KB
testcase_14 AC 98 ms
71,772 KB
testcase_15 AC 100 ms
71,768 KB
testcase_16 AC 101 ms
71,572 KB
testcase_17 AC 100 ms
71,864 KB
testcase_18 AC 99 ms
71,552 KB
testcase_19 AC 101 ms
71,456 KB
testcase_20 AC 101 ms
71,752 KB
testcase_21 AC 100 ms
71,576 KB
testcase_22 AC 101 ms
71,724 KB
testcase_23 AC 99 ms
71,824 KB
testcase_24 AC 101 ms
71,768 KB
testcase_25 AC 99 ms
71,556 KB
testcase_26 AC 98 ms
71,736 KB
testcase_27 AC 99 ms
71,692 KB
testcase_28 AC 97 ms
71,840 KB
testcase_29 AC 100 ms
71,700 KB
testcase_30 AC 100 ms
71,772 KB
testcase_31 AC 99 ms
71,636 KB
testcase_32 AC 98 ms
71,376 KB
testcase_33 AC 92 ms
71,720 KB
testcase_34 AC 95 ms
71,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


from collections import defaultdict

d = defaultdict(int)

for s in input():
    d[s] += 1
    
ans = ''
for k, v in d.items():
    
    if v == 1:
        ans += k
        
    elif v != 2:
        print('Impossible')
        exit()
        
if len(ans) != 1:
    print('Impossible')
    
else:
    print(ans)
0