結果
問題 |
No.548 国士無双
|
ユーザー |
![]() |
提出日時 | 2017-09-24 00:33:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 88 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-17 13:46:27 |
合計ジャッジ時間 | 1,379 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
S = list(input()) aToM = [chr(i) for i in range(ord('a'),ord('m')+1)] aToZ = [chr(i) for i in range(ord('a'),ord('z')+1)] ans = [] for a in aToM: T = ''.join(S) + a twoCnt = 0 oneCnt = 0 for b in aToM: if T.count(b) == 2: twoCnt += 1 for b in aToZ: if T.count(b) == 1: oneCnt += 1 if twoCnt == 1 and oneCnt + twoCnt * 2 == len(S) + 1: ans.append(a) if len(ans) == 0: print('Impossible') else: print('\n'.join(ans))