結果
問題 | No.548 国士無双 |
ユーザー |
|
提出日時 | 2019-11-13 20:51:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 641 bytes |
コンパイル時間 | 83 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-21 21:12:19 |
合計ジャッジ時間 | 1,519 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
def main(): S = input() new_str = sorted(S) myList = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"] single_cnt = 0 double_cnt = 0 ans = "" for ltr in new_str: if new_str.count(ltr) == 1: single_cnt += 1 myList.remove(ltr) elif new_str.count(ltr) == 2: double_cnt += 1 ans = ltr if single_cnt == 13: for ltr in new_str: print(ltr) elif single_cnt == 11 and double_cnt == 2: myList.remove(ans) print(myList[0]) else: print("Impossible") if __name__ == "__main__": main()