結果

問題 No.587 七対子
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-06 15:56:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 314 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 11,836 KB
実行使用メモリ 10,040 KB
最終ジャッジ日時 2023-10-19 22:11:26
合計ジャッジ時間 2,791 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 32 ms
10,040 KB
testcase_02 AC 29 ms
10,040 KB
testcase_03 AC 30 ms
10,040 KB
testcase_04 AC 30 ms
10,040 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 29 ms
10,040 KB
testcase_11 WA -
testcase_12 AC 29 ms
10,040 KB
testcase_13 AC 30 ms
10,040 KB
testcase_14 AC 30 ms
10,040 KB
testcase_15 AC 29 ms
10,040 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 29 ms
10,040 KB
testcase_20 WA -
testcase_21 AC 29 ms
10,040 KB
testcase_22 AC 29 ms
10,040 KB
testcase_23 WA -
testcase_24 AC 30 ms
10,040 KB
testcase_25 AC 29 ms
10,040 KB
testcase_26 AC 30 ms
10,040 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 30 ms
10,040 KB
testcase_32 AC 30 ms
10,040 KB
testcase_33 WA -
testcase_34 AC 30 ms
10,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
dic = {}

for i in s:
    dic.setdefault(i,0)
    dic[i]+=1
    if dic[i]==3:
        print("Impossible")
        exit

cnt = 0
ans = ""
for k,n in dic.items():
    if n==1:
        cnt+=1
        if cnt==1:
            ans=k
        else:
            print("Impossible")
            exit(0)
print(ans)
0