結果

問題 No.52 よくある文字列の問題
ユーザー ronpooronpoo
提出日時 2023-08-24 11:15:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 292 bytes
コンパイル時間 1,316 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2023-08-24 11:15:08
合計ジャッジ時間 2,592 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,516 KB
testcase_01 AC 72 ms
71,444 KB
testcase_02 AC 79 ms
76,624 KB
testcase_03 AC 71 ms
71,168 KB
testcase_04 AC 78 ms
76,528 KB
testcase_05 AC 78 ms
76,588 KB
testcase_06 AC 77 ms
76,548 KB
testcase_07 AC 79 ms
76,336 KB
testcase_08 AC 70 ms
71,320 KB
testcase_09 AC 70 ms
71,368 KB
testcase_10 AC 71 ms
71,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
L = len(S)

ss = set()
for i in range(2**L):
    v = ''
    head = 0
    tail = L-1
    for j in range(L):
        if i & 1<<j == 0:
            v += S[head]
            head += 1
        else:
            v += S[tail]
            tail -= 1
    ss.add(v)

ans = len(ss)
print(ans)
0