結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2024-08-11 16:04:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 416 bytes |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 54,144 KB |
| 最終ジャッジ日時 | 2024-08-11 16:04:21 |
| 合計ジャッジ時間 | 2,461 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
from collections import *
C = Counter(input())
ans = -1
two = 0
for i in range(13):
c = chr(ord("a") + i)
if C[c] >= 3:
print("Impossible")
exit()
if C[c] == 2:
if two == 0:
two += 1
else:
print("Impossible")
exit()
elif C[c] == 0:
if ans != -1:
print("Impossible")
exit()
else:
ans = c
if ans == -1:
for i in range(13):
c = chr(ord("a") + i)
print(c)
else:
print(ans)
rlangevin