結果

問題 No.52 よくある文字列の問題
ユーザー lloyzlloyz
提出日時 2023-03-09 00:26:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 81,800 KB
実行使用メモリ 59,680 KB
最終ジャッジ日時 2023-10-18 06:03:50
合計ジャッジ時間 1,682 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,244 KB
testcase_01 AC 38 ms
53,244 KB
testcase_02 AC 53 ms
59,676 KB
testcase_03 AC 38 ms
53,268 KB
testcase_04 AC 45 ms
59,680 KB
testcase_05 AC 45 ms
59,680 KB
testcase_06 AC 45 ms
59,680 KB
testcase_07 AC 38 ms
53,268 KB
testcase_08 AC 38 ms
53,268 KB
testcase_09 AC 37 ms
53,268 KB
testcase_10 AC 37 ms
53,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()

ans = set()
L = [('', s)]
while L:
    res, s = L.pop()
    if s == '':
        ans.add(res)
    else:
        L.append((res + s[0], s[1:]))
        L.append((res + s[-1], s[:-1]))
print(len(ans))
0