結果

問題 No.52 よくある文字列の問題
ユーザー nohakai3nohakai3
提出日時 2022-10-31 15:03:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 5,000 ms
コード長 308 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,740 KB
最終ジャッジ日時 2023-09-22 12:19:52
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,316 KB
testcase_01 AC 92 ms
71,384 KB
testcase_02 AC 106 ms
77,376 KB
testcase_03 AC 92 ms
71,748 KB
testcase_04 AC 103 ms
77,616 KB
testcase_05 AC 104 ms
77,616 KB
testcase_06 AC 104 ms
77,740 KB
testcase_07 AC 101 ms
77,236 KB
testcase_08 AC 93 ms
71,544 KB
testcase_09 AC 92 ms
71,808 KB
testcase_10 AC 92 ms
71,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
from itertools import product


s=list(input())
t=s.copy()
n=len(s)
p=set()
for bits in product([0,1],repeat=n):
    d=deque(s)
    ans=""
    for x in bits:
        if x==0:
            ans+=d.pop()
        else:
            ans+=d.popleft()
    p.add(ans)


print(len(p))
    
0