結果

問題 No.52 よくある文字列の問題
ユーザー あかりきあかりき
提出日時 2021-02-08 11:06:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 265 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 77,936 KB
最終ジャッジ日時 2023-09-18 17:13:53
合計ジャッジ時間 2,350 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,368 KB
testcase_01 AC 89 ms
71,512 KB
testcase_02 AC 138 ms
77,928 KB
testcase_03 AC 90 ms
71,312 KB
testcase_04 AC 108 ms
77,652 KB
testcase_05 AC 105 ms
77,756 KB
testcase_06 AC 106 ms
77,936 KB
testcase_07 AC 99 ms
76,824 KB
testcase_08 AC 89 ms
71,684 KB
testcase_09 AC 87 ms
71,384 KB
testcase_10 AC 88 ms
71,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import copy
s=list(input())
n=len(s)
l=[]
for i in range(2**n):
  x=format(i,'0'+str(n)+'b')
  s2=copy.copy(s)
  l2=[]
  for j in range(n):
    if x[j]=='0':
      l2.append(s2.pop(0))
    else:
      l2.append(s2.pop(-1))
  l.append(''.join(l2))
print(len(set(l)))
0