結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-25 17:04:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 2,000 ms |
| コード長 | 457 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 82,408 KB |
| 実行使用メモリ | 55,616 KB |
| 最終ジャッジ日時 | 2025-11-25 17:04:36 |
| 合計ジャッジ時間 | 2,959 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
from collections import Counter
import sys
def input(): return sys.stdin.readline().rstrip('\n')
def main():
s = input()
c = Counter(s)
ans = None
for k, v in c.items():
if v == 1:
if ans is not None:
print('Impossible')
return
ans = k
if v not in [1, 2]:
print('Impossible')
return
print(ans)
if __name__ == '__main__':
main()