結果

問題 No.548 国士無双
ユーザー 141sksk141sksk
提出日時 2019-11-13 20:51:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 641 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,840 KB
実行使用メモリ 9,868 KB
最終ジャッジ日時 2023-10-21 19:47:35
合計ジャッジ時間 1,779 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,868 KB
testcase_01 AC 27 ms
9,868 KB
testcase_02 AC 31 ms
9,868 KB
testcase_03 AC 30 ms
9,868 KB
testcase_04 AC 29 ms
9,868 KB
testcase_05 AC 25 ms
9,868 KB
testcase_06 AC 25 ms
9,868 KB
testcase_07 AC 26 ms
9,868 KB
testcase_08 AC 26 ms
9,868 KB
testcase_09 AC 27 ms
9,868 KB
testcase_10 AC 26 ms
9,868 KB
testcase_11 AC 27 ms
9,868 KB
testcase_12 AC 27 ms
9,868 KB
testcase_13 AC 25 ms
9,868 KB
testcase_14 AC 25 ms
9,868 KB
testcase_15 AC 26 ms
9,868 KB
testcase_16 AC 26 ms
9,868 KB
testcase_17 AC 25 ms
9,868 KB
testcase_18 AC 26 ms
9,868 KB
testcase_19 AC 26 ms
9,868 KB
testcase_20 AC 27 ms
9,868 KB
testcase_21 AC 27 ms
9,868 KB
testcase_22 AC 26 ms
9,868 KB
testcase_23 AC 26 ms
9,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0