結果

問題 No.52 よくある文字列の問題
ユーザー 👑 KazunKazun
提出日時 2020-10-27 15:59:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 284 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,844 KB
最終ジャッジ日時 2023-09-29 03:17:48
合計ジャッジ時間 2,751 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,784 KB
testcase_01 AC 96 ms
71,448 KB
testcase_02 AC 106 ms
77,792 KB
testcase_03 AC 95 ms
71,652 KB
testcase_04 AC 111 ms
77,752 KB
testcase_05 AC 109 ms
77,804 KB
testcase_06 AC 110 ms
77,844 KB
testcase_07 AC 109 ms
77,472 KB
testcase_08 AC 95 ms
71,620 KB
testcase_09 AC 95 ms
71,596 KB
testcase_10 AC 94 ms
71,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
from collections import deque

S=input()
N=len(S)

A=set()

for T in product([0,1],repeat=N):
    Q=deque(S)
    X=""
    for x in T:
        if x==0:
            y=Q.popleft()
        else:
            y=Q.pop()
        X+=y

    A.add(X)

print(len(A))
0