結果

問題 No.52 よくある文字列の問題
ユーザー kohei2019kohei2019
提出日時 2021-03-18 11:40:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 67,712 KB
最終ジャッジ日時 2024-04-28 02:30:12
合計ジャッジ時間 1,193 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
60,032 KB
testcase_01 AC 38 ms
60,032 KB
testcase_02 AC 49 ms
67,200 KB
testcase_03 AC 39 ms
60,092 KB
testcase_04 AC 49 ms
67,328 KB
testcase_05 AC 49 ms
67,072 KB
testcase_06 AC 51 ms
67,712 KB
testcase_07 AC 49 ms
65,792 KB
testcase_08 AC 41 ms
60,672 KB
testcase_09 AC 39 ms
59,904 KB
testcase_10 AC 38 ms
60,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import copy
S = input()
N = len(S)
ansset = set()
Sls = list(S)
Sdeq = collections.deque(Sls)
for i in range(2**N):
    word = []
    Sdeq1 = copy.copy(Sdeq)
    for j in range(N):
        if (i >> j)&1:
            word.append(Sdeq1.pop())
        else:
            word.append(Sdeq1.popleft())
    ansset.add(''.join(word))
print(len(ansset))
0