結果

問題 No.52 よくある文字列の問題
ユーザー flippergoflippergo
提出日時 2020-12-22 10:42:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 211 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 53,392 KB
最終ジャッジ日時 2023-10-21 12:45:04
合計ジャッジ時間 1,712 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

S = input().strip()
A = [(S,"")]
ans = set()
while A:
    a,x = A.pop()
    if len(a)==1:
        ans.add(x+a)
    if len(a)>1:
        A.append((a[1:],x+a[0]))
        A.append((a[:-1],x+a[-1]))
print(len(ans))
0