結果

問題 No.587 七対子
ユーザー wajima_wataru
提出日時 2018-01-03 19:06:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-19 19:49:30
合計ジャッジ時間 2,148 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

nums = [0 for _ in range(26)]
for c in input():
    nums[ord(c) - 97] += 1
ans = ''
for i, num in enumerate(nums):
    if num > 2:
        print('Impossible')
        exit()
    elif num == 1:
        if not ans == '':
            print('Impossible')
            exit()
        else:
            ans = chr(i + 97)
print(ans)
0