結果

問題 No.52 よくある文字列の問題
ユーザー ゆるくゆるく
提出日時 2015-02-22 19:45:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 11,036 KB
実行使用メモリ 10,416 KB
最終ジャッジ日時 2023-09-06 02:59:58
合計ジャッジ時間 1,528 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,408 KB
testcase_01 AC 31 ms
10,384 KB
testcase_02 AC 32 ms
10,248 KB
testcase_03 WA -
testcase_04 AC 32 ms
10,364 KB
testcase_05 AC 32 ms
10,284 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 31 ms
10,312 KB
testcase_10 AC 31 ms
10,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

memo = defaultdict(int)
s = input()
sn = len(s)
count = 0
def solve(a,b):
  global count
  if a == "":
    if not memo[b]:
      count += 1
      memo[b] = True
    return
  l = len(a)
  if l > 1:
    solve(s[1:l], b + a[0])
    solve(s[0:l - 1], b + a[l - 1])
  else:
    solve("", b + a)
solve(s, "")
print(count)
0