結果

問題 No.52 よくある文字列の問題
ユーザー Akijin_007
提出日時 2022-10-17 18:15:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 307 ms
コンパイル使用メモリ 81,964 KB
実行使用メモリ 68,028 KB
最終ジャッジ日時 2024-06-28 08:27:33
合計ジャッジ時間 1,337 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

a = []
l = len(S)

for i in range(l):
    a.append(S[i])

from collections import deque

s = set()

for i in range(1 << l):
    b = format(i, "0" + str(l) + "b")
    c = deque(a)
    t = ""
    for j in range(l):
        if b[j] == "0":
            t += c.pop()
        else:
            t += c.popleft()

    s.add(t)

print(len(s))
0