結果

問題 No.52 よくある文字列の問題
ユーザー ゆるくゆるく
提出日時 2015-02-22 20:11:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 531 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 11,272 KB
最終ジャッジ日時 2023-10-22 03:57:47
合計ジャッジ時間 1,218 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
11,224 KB
testcase_01 AC 32 ms
11,224 KB
testcase_02 AC 32 ms
11,224 KB
testcase_03 AC 32 ms
11,224 KB
testcase_04 AC 31 ms
11,272 KB
testcase_05 AC 32 ms
11,228 KB
testcase_06 AC 34 ms
11,264 KB
testcase_07 AC 33 ms
11,240 KB
testcase_08 AC 32 ms
11,224 KB
testcase_09 AC 32 ms
11,224 KB
testcase_10 AC 31 ms
11,224 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 b == "aaa":
      print(b)
      sys.exit(0)
    if not memo[b]:
      count += 1
      memo[b] = True
    return
  l = len(a)
  solve(a[1:l], b + a[0])
  solve(a[0:l - 1], b + a[l - 1])
solve(s, "")
print(count)
0