結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-10-03 08:31:44 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 161 ms / 2,000 ms |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 576 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 36,144 KB |
| 最終ジャッジ日時 | 2026-04-02 18:11:19 |
| 合計ジャッジ時間 | 7,183 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
# coding: utf-8
def main():
s = input()
d = count(s)
e = list(filter(lambda t: t[1] != 2, d.items()))
if len(e) == 1 and e[0][1] == 1:
print(e[0][0])
else:
print('Impossible')
def count(s):
return { c: len(list(filter(lambda x: x == c, s))) for c in set(s) }
if __name__ == '__main__':
main()