結果

問題 No.52 よくある文字列の問題
ユーザー KudeKude
提出日時 2020-09-07 01:34:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 5,000 ms
コード長 291 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 77,816 KB
最終ジャッジ日時 2023-08-19 14:37:09
合計ジャッジ時間 2,155 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,572 KB
testcase_01 AC 82 ms
71,588 KB
testcase_02 AC 104 ms
77,816 KB
testcase_03 AC 80 ms
71,676 KB
testcase_04 AC 92 ms
77,244 KB
testcase_05 AC 91 ms
77,140 KB
testcase_06 AC 91 ms
77,644 KB
testcase_07 AC 88 ms
77,684 KB
testcase_08 AC 79 ms
71,592 KB
testcase_09 AC 82 ms
71,736 KB
testcase_10 AC 83 ms
71,588 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