結果

問題 No.52 よくある文字列の問題
ユーザー KudeKude
提出日時 2020-09-07 01:34:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 291 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,092 KB
実行使用メモリ 67,288 KB
最終ジャッジ日時 2024-05-06 21:42:44
合計ジャッジ時間 1,267 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,328 KB
testcase_01 AC 39 ms
55,284 KB
testcase_02 AC 52 ms
66,420 KB
testcase_03 AC 38 ms
54,656 KB
testcase_04 AC 50 ms
66,516 KB
testcase_05 AC 49 ms
66,428 KB
testcase_06 AC 52 ms
67,288 KB
testcase_07 AC 49 ms
65,028 KB
testcase_08 AC 43 ms
60,000 KB
testcase_09 AC 38 ms
54,488 KB
testcase_10 AC 38 ms
53,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
s = input()
l = len(s)
sset = set()
for b in range(1 << l):
    d = deque(s)
    t = []
    for i in range(l):
        if b >> i & 1:
            c = d.popleft()
        else:
            c = d.pop()
        t.append(c)
    sset.add(''.join(t))
print(len(sset))
0