結果

問題 No.52 よくある文字列の問題
ユーザー 👑 colognecologne
提出日時 2022-01-24 20:03:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 334 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,136 KB
実行使用メモリ 76,060 KB
最終ジャッジ日時 2023-08-21 11:13:08
合計ジャッジ時間 2,024 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,452 KB
testcase_01 AC 71 ms
71,444 KB
testcase_02 AC 79 ms
76,016 KB
testcase_03 AC 73 ms
71,248 KB
testcase_04 AC 79 ms
76,036 KB
testcase_05 AC 79 ms
76,060 KB
testcase_06 AC 80 ms
75,816 KB
testcase_07 AC 73 ms
71,300 KB
testcase_08 AC 73 ms
71,204 KB
testcase_09 AC 74 ms
71,372 KB
testcase_10 AC 73 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input(): return sys.stdin.readline().rstrip()


def main():
    s = input()
    ans = set()

    def bktk(c, r):
        if r == '':
            ans.add(c)
        else:
            bktk(c + r[-1], r[:-1])
            bktk(c + r[0], r[1:])

    bktk('', s)
    print(len(ans))


if __name__ == '__main__':
    main()
0