TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())

def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        print(s+c)
        ret += dfs(s+c)
    return ret

print(dfs('0'))


n = int(input())

def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s+c)
    return ret

print(dfs('0'))


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())
 
def dfs(s):
    print(s)
    if int(s) > n:
        return 0
    if s.count('3') > 0 and s.count('5') > 0 and s.count('7') > 0:
        cnt = 1
    else:
        cnt = 0
    cnt += dfs(s + '3')
    cnt += dfs(s + '5')
    cnt += dfs(s + '7')
    return cnt
 
 
print(dfs('0'))

n = int(input())
 
def dfs(s):

    if int(s) > n:
        return 0
    if s.count('3') > 0 and s.count('5') > 0 and s.count('7') > 0:
        cnt = 1
    else:
        cnt = 0
    cnt += dfs(s + '3')
    cnt += dfs(s + '5')
    cnt += dfs(s + '7')
    return cnt
 
 
print(dfs('0'))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):

if N < 357:
    print(0)
else:
    cnt = 1
    for n in range(358, N + 1):
        if set(str(n)) == set(['7', '5', '3']):
            cnt += 1
    print(cnt)

# input
N = int(input())


if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = set(["7", "5", "3"])
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)

from itertools import product

# input
N = int(input())


if N < 357:
    print(0)
else:
    max_dig = len(str(N))
    dig = 3
    sgs_nuns = []
    sgs = {"7", "5", "3"}
    str_join = "".join
    for n in range(3, max_dig + 1):
        sgs_nuns += [
            str_join(n)
            for n in product(["7", "5", "3"], repeat=n)
            if set(str_join(n)) == sgs and int(str_join(n)) <= N
        ]

    cnt = len(sgs_nuns)
    print(cnt)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())
# Recursion!
def detector(str):
  # Stop the operation if the number is bigger than n.
  if int(str) > n:
    return 0
  else:
    count = 0
    # Add 7, 5, or 3 after the number. 
    # Eliminate numbers that do not consist of only 3, 5, and 7.
    for i in "753":
      count += detector(str+i)
    # Check if the number has all 3, 5, and 7.
    if "3" not in str or "5" not in str or "7" not in str:
      return count
    else:
      return count += 1
# Start from 0 and do the operation until the number exceeds n.
detector("0")

n = int(input())
# Recursion!
def detector(str):
  # Stop the operation if the number is bigger than n.
  if int(str) > n:
    return 0
  else:
    count = 0
    # Add 7, 5, or 3 after the number. 
    # Eliminate numbers that do not consist of only 3, 5, and 7.
    for i in "753":
      count += detector(str+i)
    # Check if the number has all 3, 5, and 7.
    if "3" not in str or "5" not in str or "7" not in str:
      return count
    else:
      return count + 1
# Start from 0 and do the operation until the number exceeds n.
print(detector("0"))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):


from itertools import product
N = input()
n = int(N)
ans = 0
for i in range(len(N)+1):
    for s in product(["3","5","7"],repeat=i):
        if int("".join(s)) <= n and "3" in s and "5" in s and "7" in s:
            ans += 1
print(ans)


n = int(input())
s = '753'

stack = ['']
cnt = 0
while stack:
    t = stack.pop()
    for c in s:
        u = t + c
        if int(u) <= n:
            if '7' in u and '5' in u and '3' in u:
                # print(u)
                cnt += 1
            stack.append(u)
print(cnt)


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N=int(input())

def dfs(s):
    if int(s)>N:
        return 0
    
    if all(s.count(c)>0 for c in "753"):
        ret=1
    else:
        ret=0

    for c in "753":
        ret+=dfs(s+c)
    return ret

dfs("0")

N=int(input())

def dfs(s):
    if int(s)>N:
        return 0
    
    if all(s.count(c)>0 for c in "753"):
        ret=1
    else:
        ret=0

    for c in "753":
        ret+=dfs(s+c)
    return ret

print(dfs("0"))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools
print(1)

s = int(input())

import numpy as np
import itertools
candess = []
cnt = 0

for i in range(3, 10):
    candes = list((itertools.product([3,5,7], repeat=i)))
    for cande in candes:
        if (3 in cande) and (5 in cande) and (7 in cande) and \
        (int(''.join(map(str, cande)))) <= s:
            cnt += 1
print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N=999999999
l=len(str(N))

def calc(st):
    st=str(st)
    if(len(st)>l):return 0
    t=calc(st+"3")
    f=calc(st+"5")
    s=calc(st+"7")
    o=0
    if(st.find("7")>=0 and st.find("5")>=0 and st.find("3")>=0 and int(st)<=N):
        o=1
    return (t+f+s+o)

print(calc(str()))







N=int(input())
l=len(str(N))

def calc(st):
    st=str(st)
    if(len(st)>l):return 0
    t=calc(st+"3")
    f=calc(st+"5")
    s=calc(st+"7")
    o=0
    if(st.find("7")>=0 and st.find("5")>=0 and st.find("3")>=0 and int(st)<=N):
        o=1
    return (t+f+s+o)

print(calc(str()))







Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N = int(input())

print(3**N - 3*(2**N - 2) - 3)

import itertools
N=int(input())

answer = 0
for n in range(1,10):
  for l in itertools.product(['7','3','5'], repeat=n):
    if '7' in l and '5' in l and '3' in l:
      answer += (int(''.join(l))<=N)

print(answer)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
def dfs(s, n):
    if int(s) > n:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        result = 1
    else:
        result = 0
    for c in '753':
        print(s + c)
        result += dfs(s + c, n)

    return result


def main():
    n = int(input())

    print(dfs('0', n))


if __name__ == '__main__':
    main()


def dfs(s, n):
    if int(s) > n:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        result = 1
    else:
        result = 0
    for c in '753':
        result += dfs(s + c, n)

    return result


def main():
    n = int(input())
    print(dfs('0', n))


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())
from itertools import product
ans = 0
for i in range(1, 11):
  for p in product("357", repeat=i):
    v = "".join(p)
    if "3" in v and "5" in v and "7" in v and int("".join(p)) <= N:
      ans += 1
print(ans)

n = int(input())
from itertools import product
ans = 0
for i in range(1, 11):
  for p in product("357", repeat=i):
    v = "".join(p)
    if "3" in v and "5" in v and "7" in v and int("".join(p)) <= n:
      ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5").t.count("7")
        
        if int("".join(t)): <= N and check:
            count += 1

print(count)

from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)): <= N and check:
            count += 1

print(count)

from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(2,10):
    for t in product(num_list, repeat=i):
        check = t.count("3")*t.count("5").t.count("7")
        if int("".join(t)): <= N and check:
            count += 1

print(count)

N = int(input())
count = 0

for i in range(357, N+1):

    i_str = str(i)

    if i_str[-1] != "3" or i_str[-1] != "5" or i_str[-1] != "7":
        continue
 
    thr = i_str.count("3")
    fiv = i_str.count("5")
    sev = i_str.count("7")


    if len(i_str) == thr + fiv + sev:
        if thr > 0:
             if fiv > 0:
                if sev > 0: 
                    count += 1

print(count)

from itertools import product

N = int(input())
num_list = ["3", "5", "7"]
count = 0

for i in range(3, 10):
    for t in (product(num_list, repeat=i)):
        check = t.count("3")*t.count("5")*t.count("7")
        if int("".join(t)) <= N and check:
            count += 1


print(count)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N = int(input())

def dfs(s):
  
  if int(s) > N:
    return 0
  
  
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0
  
  return sum((dfs(s+c) for c in '753'))

print(dfs('0'))

N = int(input())

def dfs(s):
  
  if len(s) > 0 and int(s) > N:
    return 0
  
  
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0
  
  return ret + sum((dfs(s+c) for c in '753'))

print(dfs(''))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools
import math

n = input()
if(int(n)<357):
    print(0)
    exit()

ans = 0

for i in range(3,len(n)+1):
    if len(n) == i:
        for v in itertools.product(['3','5','7'],repeat=i):
            if '3' in v and '5' in v and '7' in v:
                if int(''.join(v)) <= int(n):
                    print(v)
                    ans += 1
    else:
        ans += 3 ** i - 2 ** i * 3 + 3
print(ans)

import itertools
import math

n = input()
if(int(n)<357):
    print(0)
    exit()

ans = 0

for i in range(3,len(n)+1):
    if len(n) == i:
        for v in itertools.product(['3','5','7'],repeat=i):
            if '3' in v and '5' in v and '7' in v:
                if int(''.join(v)) <= int(n):
                    ans += 1
    else:
        ans += 3 ** i - 2 ** i * 3 + 3
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = input()
def f(s):
  if int(s) > n:
    return 0 
  if s.count("3") > 0 and s.count("5") > 0 and s.count("7") > 0:
    cnt += 1
  else:
    cnt += f(s + "3")
    cnt += f(s + "5")
    cnt += f(s + "7")
    
print(cnt)
    
    

n = int(input())
def f(s):
  if int(s) > n:
    return 0 
  if s.count("3") > 0 and s.count("5") > 0 and s.count("7") > 0:
  	cnt = 1
  else:
  	cnt = 0
  cnt += f(s + "3")
  cnt += f(s + "5")
  cnt += f(s + "7")
  return cnt
  
result = f("0")
print(result)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))


n = int(input())


def dfs(s):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())

def dfs(s):
    if int(s) > 0:
        return 0
    ret =1 if all (s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs (s+c)
    return ret

print(dfs('0'))




#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = [x+1 for x in range(N)]
candidates = [str(x) for x in ls if "7" in str(x) and "5" in str(x) and "3" in str(x))
count = 0
for _ in range len(candidates):
    candlist = list(candidates)
    ls2 = [x for x in candlist if x != 7 and x != 5 and x != 3]
    if ls2 is False:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = [x+1 for x in range(N)]
candidates = [str(x) for x in ls if "7" in str(x) and "5" in str(x) and "3" in str(x)]
count = 0
for _ in range (len(candidates)):
    candlist = list(candidates)
    ls2 = [x for x in candlist if x != "7" and x != "5"and x != "3"]
    if ls2 is False:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = [x+1 for x in range(N)]
candidates = [str(x) for x in ls if "7" in str(x) and "5" in str(x) and "3" in str(x))
count = 0
for _ in range len(candidates):
    candlist = list(candidates)
    ls2 = [x for x in candlist if x != "7" and x != "5"and x != "3"]
    if ls2 is False:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
count = 0
for i in range (N):
    num = str(i+1)
    ls = list(num)
    ls2 = [x for x in ls if int(x) != 7 and int(x) != 5 and int(x) !=3]
    if ls2 is False and "7" in num and "5" in num and "3" in num:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = [x+1 for x in range(N)]
candidates = [str(x) for x in ls if "7" in str(x) and "5" in str(x) and "3" in str(x)]
count = 0
for _ in range len(candidates):
    candlist = list(candidates)
    ls2 = [x for x in candlist if x != "7" and x != "5"and x != "3"]
    if ls2 is False:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
count = 0
for i in range (N):
    num = str(i+1)
    ls = list(num)
    ls2 = [x for x in ls if int(x) != 7 and int(x) != 5 and int(x) !=3]
    if ls2 is False:
        count += 1

print(count)


#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    ret =1 if all (s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs (s+c)
    return ret

print(dfs('0'))




Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs(''))

N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs('0'))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
from collections import deque
n = int(input())
q = deque()
q.append('')
res = set()
while q:
    m = q.pop_front()
    for c in '357':
        if int(m+c) > n: continue
        q.append(m+c)
    for c in '357':
        if c not in m: break
    else:
        res.add(m)
print(len(res))

from collections import deque
n = int(input())
q = deque()
q.append('')
res = set()
while q:
    m = q.popleft()
    for c in '357':
        if int(m+c) > n: continue
        q.append(m+c)
    for c in '357':
        if c not in m: break
    else:
        res.add(m)
print(len(res))


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N=int(input())
def f(s):
    t=s
    num=0
    ten=1
    L=[0,0,0,1]
    while t!=0:
        a=t%3
        if a==0:
            num+=3*ten
            L[0]=1
        elif a==1:
            num+=5*ten
            L[1]=1
        elif a==2:
            num+=7*ten
            L[2]=1
        ten*=10
        t=t//3
    return num,L
ans=0
for i in range(1,3**9):
    num,L=f(i)
    if num<=N and L==[1,1,1,1]:
        ans+=1
        #print(num)
print(ans)

from itertools import product

if __name__ == '__main__':
    N = int(input())
    count = 0
    digits = len(str(N))
    
    for n in range(1, digits+1):

        for t in product('357', repeat=n):
            num = ''.join(t)
            if int(num) <= N:
                if '3' in num and '5' in num and '7' in num:
                    count += 1
    print(count)
            

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools


def solve():

    N = int(input())
    num = str(N)

    ans = []
    dig = len(num)
    for x in range(dig):
        com = []
        com.append(('', '3', '5', '7'))
        for y in range(x):
            com.append(('3', '5', '7'))
        ans.append(com)

    temp = [list(itertools.product(*k)) for k in ans]

    tempanswer = [j for i in temp for j in i if (j.count(
        '3') >= 1 and j.count('5') >= 1 and j.count('7') >= 1)]

    answer = [int("".join(y)) for y in tempanswer if int("".join(y)) < N]
    res = list(set(answer))
    print(len(answer))
    print(answer)


solve()

import itertools
if __name__ == '__main__':
  
  N = input()
  n = int(N)
  count = 0
  for i in range(0, len(N)):

    temp = itertools.product(["3", "5", "7"], repeat=i+1)
    for j in temp:
      s = "".join(j)
      
      if ("3" in s and "5" in s and "7" in s and int(s) <= n):
        count += 1
  
  print(count)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N = input()

li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))

N = input()
import itertools
li = []
for v in itertools.product('0357', repeat=len(N)):
    a = ''
    for w in v:
        a = a + w
    li.append(a)

li2 = []
for v in li:
    if '3' in v and '5' in v and '7' in v and int(v) <= int(N):
        v = v.replace('0', '')
        li2.append(v)
    else: pass
print(len(set(li2)))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())

def abc(s):
  t = all('3' in s, '5' in s, '7' in s)
  if len(s) < len(n):
    return abc(s+'3') + abc(s+'5') + abc(s+'7') + t
  elif s <= n:
    return t
  else:
    return 0
print(abc(''))

n = int(input())

def dfs(s):
  if int(s) > n:
    return 0
  if all(s.count(c)>0 for c in '753'):
    t = 1
  else:
    t = 0
  for c in '753':
    t += dfs(s+c)
  return t

print(dfs('0'))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n_str = input()
n = int(n_str)
digit = len(n_str)
top = int(n_str[0])

def calc_add(digit):
    return (3 ** (digit) - ((2 ** (digit)) * 2) + 1) if digit >= 2 else 0 

answer = 0
if(digit > 3):
    for(pre_digit) in range(3, digit):
        answer += calc_add(pre_digit - 1) * 3

add = calc_add(digit - 1)
print("left:{} add:{}".format(answer, add))
if(top > 3):
    
    answer += add
if(top > 5):
    
    answer += add
if(top > 7):
    
    answer += add

if (top == 3 or top == 5 or top == 7):
    
    for number in range(top * (10 ** (digit - 1)), n):
        count3 = 0
        count5 = 0
        count7 = 0
        for num in str(number):
            if(int(num) == 3):
                count3 += 1
            elif(int(num) == 5):
                count5 += 1
            elif(int(num) == 7):
                count7 += 1 
            else:
                break
        else:
            if(count3 != 0 and count5 != 0 and count7 != 0):
                print("num:{}".format(number))
                answer += 1
print (answer)

n_str = input()
n = int(n_str)
digit = len(n_str)
top = int(n_str[0])

def calc_add(digit):
    return (3 ** (digit) - ((2 ** (digit)) * 2) + 1) if digit >= 2 else 0 

answer = 0
if(digit > 3):
    for(pre_digit) in range(3, digit):
        answer += calc_add(pre_digit - 1) * 3

add = calc_add(digit - 1)
if(top > 3):
    
    answer += add
if(top > 5):
    
    answer += add
if(top > 7):
    
    answer += add

if (top == 3 or top == 5 or top == 7):
    
    
    chk_list = []
    char_list = ["3", "5", "7"]
    counter = 0
    while True:
        string = str(top)
        cp_counter = counter
        for index in reversed(range(0, (digit - 1))):
            string += char_list[(cp_counter // (3 ** (index)))]
            cp_counter -=  (3 ** (index)) * (cp_counter // (3 ** (index)))
        if int(string) <= n:
           chk_list.append(tuple(string))
        counter += 1
        if counter >= 3 ** (digit - 1):
            break
    
    for string_number in chk_list:
        count3 = 0
        count5 = 0
        count7 = 0
        for num in string_number:
            if(int(num) == 3):
                count3 += 1
            elif(int(num) == 5):
                count5 += 1
            elif(int(num) == 7):
                count7 += 1 
            else:
                break
        else:
            if(count3 != 0 and count5 != 0 and count7 != 0):
                answer += 1
print (answer)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n=int(input())

def dfs(s):
    if int(s)>n:
        return 0
    ret=1 if all(s.count(c)>0 for c in "753") else 0
    for c in "753":
        ret+=dfs(s+c)
    return ret

print("0")


n=int(input())
def dfs(x):
    if int(x)>n:
        return 0
    c=1 if all(x.count(l)>0 for l in "753") else 0
    for i in "753":
        c+=dfs(x+i)
    return c
print(dfs("0"))


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

MAX_LIM = 10**9
N = (input())
keta = len(N)
N = int(N)

print(pow(3, 9))
keta_lis = {1: [3, 5, 7], 2: [], 3: [],
            4: [], 5: [], 6: [], 7: [], 8: [], 9: []}
for i in range(1, keta):
    times = pow(10, i)
    for tmp in keta_lis[i]:
        for num in [3, 5, 7]:
            keta_lis[i+1].append(tmp + times*num)
ans = []
for keta in keta_lis.keys():
    ans.extend(keta_lis[keta])
ans = np.array(sorted(ans))
ans = ans[357 <= ans]
ans = ans[ans <= N]
count = 0
for ans_ in ans:
    if (('3' in str(ans_)) and ('5' in str(ans_)) and ('7' in str(ans_))):
        # print(ans_)
        count += 1
print(count)

# print(ans[357 <= ans])


import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect

MAX_LIM = 10**9
N = (input())
keta = len(N)
N = int(N)

# print(pow(3, 9))
keta_lis = {1: [3, 5, 7], 2: [], 3: [],
            4: [], 5: [], 6: [], 7: [], 8: [], 9: []}
for i in range(1, keta):
    times = pow(10, i)
    for tmp in keta_lis[i]:
        for num in [3, 5, 7]:
            keta_lis[i+1].append(tmp + times*num)
ans = []
for keta in keta_lis.keys():
    ans.extend(keta_lis[keta])
ans = np.array(sorted(ans))
ans = ans[357 <= ans]
ans = ans[ans <= N]
count = 0
for ans_ in ans:
    if (('3' in str(ans_)) and ('5' in str(ans_)) and ('7' in str(ans_))):
        # print(ans_)
        count += 1
print(count)

# print(ans[357 <= ans])


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools
n=input()
c=[0,0,6,36,150,540,1806,5796,18150]
b=len(list(a for a in itertools.product(["3","5","7"],repeat=len(n))if len(set(a))==3 and int("".join(a))<int(n)))
print(sum(c[:l-1])+b)


n=int(input())



def dfs(s):
    ans=0
    if int(s)>n:
        return 0
    else:
        ans+=all(map(s.count,"357"))
        for i in "357":
            ans+=dfs(s+i)
    return ans
print(dfs("0"))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
def prf(m):
    pf = {}
    for i in range(2,int(m**0.5)+1):
        while m % i == 0:
            pf[i] = pf.get(i,0)+1
            m //= i
    if m>1:pf[m] = 1
    return pf
import bisect
from collections import defaultdict
Pr = defaultdict(lambda: -1)

m = int(input())
for i in range(1,m+1):
    j = prf(i)
    for k, l in j.items():
        Pr[k] -= l
A = list(Pr.values())
a = dict() 
for i in [3,5,15,25,75]:
    a[i] = bisect.bisect_right(A,-i)
print(a[3]*a[5]*(a[5]-1)//2+(a[15]-a[5])*(a[5]-1)+(a[3]-1)*a[25]+a[75]) 

import bisect
N = int(input())
S = set([7,5,3])
for i in range(8):
    for j in S.copy():
        for k in [7,5,3]:
            S.add(10*j+k)
T = []
for i in S:
    if str(i).count('3') and str(i).count('5') and str(i).count('7'):
        T.append(i)
T.sort()
print(bisect.bisect_right(T,N))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n=int(input())
tmp=2
ans=0
Flag=True
while Flag:
    tmp+=1
    iterator=product(range(3),repeat=tmp)
    for idxs in iterator:
        num=''.join(map(str,idxs))
        num753=str(num).replace('0', '3').replace('1', '5').replace('2', '7')
        if '7' in num753 and '5' in num753 and '3' in num753:
            if int(num753)<=n:
                ans+=1
            else:
                Flag=False
                break
print(ans)

from itertools import product
n=int(input())
tmp=2
ans=0
Flag=True
while Flag:
    tmp+=1
    iterator=product(range(3),repeat=tmp)
    for idxs in iterator:
        num=''.join(map(str,idxs))
        num753=str(num).replace('0', '3').replace('1', '5').replace('2', '7')
        if '7' in num753 and '5' in num753 and '3' in num753:
            if int(num753)<=n:
                ans+=1
            else:
                Flag=False
                break
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n=int(input())

def dfs(s):
  if int(s)>n:
    return 0
  cnt=1 if all(s.count(i)>0 for i in '753') else 0
  for j in '753':
    cnt+=dfs(s+j)
  retunr cnt
  
print(dfs('0')

n=int(input())

def dfs(s):
  if int(s)>n:
    return 0
  cnt=1 if all(s.count(i)>0 for i in '753') else 0
  for j in '753':
    cnt+=dfs(s+j)
  return cnt
  
print(dfs('0'))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
print("")

import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

N = int(input())


def answer(info, ans):
    if max(ans) > N:
        return ans
    info2 = []
    for i in info:
        for l in ["3", "5", "7"]:
            info2.append(int(str(i) + l))
    ans += info2
    return answer(info2, ans)


a = sorted(list(set(answer([3, 5, 7], [3, 5, 7]))))
num = 0
for i in range(len(a)):
    if a[i] > N:
        print(num)
        break
    elif all(str(a[i]).count(d) > 0 for d in "753"):
        num += 1


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools

n = input()
ans =0

    
if len(n) < 3:
    ans = 0
elif len(n) == 3:
    con = []
    for i in range(len(n)-2):
        con.append(3)
        con.append(5)
        con.append(7)
    p_list = list(itertools.permutations(con, len(n)))

else:
    if int('7'*len(n)) <= int(n):
        ans = 3**(len(n))- 3*2**(len(n)) + 3
    elif int('3'*len(n)) > int(n):
        ans = 0
    else:
        con = []
        for i in range(len(n)):
            con.append(0)
        con_num = []
        for i in range(3**len(n)):
            con[-1] +=1
            for j in range(len(n)-1,0,-1):
                if con[j] == 3:
                    con[j-1] +=1
                    con[j] = 0
            if con[0] == 0:
                b = '3'
            elif con[0] == 1:
                b= '5'
            elif con[0] == 2:
                b = '7'
            for j in range(1,len(n)):
                if con[j] == 0:
                    a = '3'
                elif con[j] == 1:
                    a = '5'
                elif con[j] == 2:
                    a = '7'
                b += a
            c = list(b)
            if c.count('3') != 0 and c.count('5') != 0 and c.count('7') != 0 and len(b) == len(n):
                con_num.append(int(b))
        for i in range(len(con_num)):
            if int(n) >= con_num[i]:
                ans +=1
    for i in range(3,len(n)):
        ans += 3**(i)- 3*2**(i) + 3
    

print(ans)

import itertools

n = input()
ans =0

    
if len(n) < 3:
    ans = 0

else:
    if int('7'*len(n)) <= int(n):
        ans = 3**(len(n))- 3*2**(len(n)) + 3
    elif int('3'*len(n)) > int(n):
        ans = 0
    else:
        con = []
        for i in range(len(n)):
            con.append(0)
        con_num = []
        for i in range(3**len(n)):
            con[-1] +=1
            for j in range(len(n)-1,0,-1):
                if con[j] == 3:
                    con[j-1] +=1
                    con[j] = 0
            if con[0] == 0:
                b = '3'
            elif con[0] == 1:
                b= '5'
            elif con[0] == 2:
                b = '7'
            for j in range(1,len(n)):
                if con[j] == 0:
                    a = '3'
                elif con[j] == 1:
                    a = '5'
                elif con[j] == 2:
                    a = '7'
                b += a
            c = list(b)
            if c.count('3') != 0 and c.count('5') != 0 and c.count('7') != 0 and len(b) == len(n):
                con_num.append(int(b))
        for i in range(len(con_num)):
            if int(n) >= con_num[i]:
                ans +=1
    for i in range(3,len(n)):
        ans += 3**(i)- 3*2**(i) + 3
    

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N=input()
a=0
if 10**(len(N)-1)*5+1>int(N)>10**(len(N)-1)*3+1:
    for i in range(10**(len(N)-1)*3+1,int(N)+1,2):
        j=str(i)
        if "3"in j and "5"in j and "7"in j:
            if len(j)==j.count("3")+j.count("5")+j.count("7"):
                a+=1
    a+=3**(len(N)-1)-3*2**(len(N)-1)+3
elif 10**(len(N)-1)*7+1>int(N)>10**(len(N)-1)*5+1:
    for i in range(10**(len(N)-1)*5+1,int(N)+1,2):
        j=str(i)
        if "3"in j and "5"in j and "7"in j:
            if len(j)==j.count("3")+j.count("5")+j.count("7"):
                a+=1
    a+=2*3**(len(N)-1)-5*2**(len(N)-1)+15
elif 10**(len(N)-1)*7+1<int(N):
    for i in range(10**(len(N)-1)*7+1,int(N)+1,2):
        j=str(i)
        if "3"in j and "5"in j and "7"in j:
            if len(j)==j.count("3")+j.count("5")+j.count("7"):
                a+=1
    a+=3*3**(len(N)-1)-7*2**(len(N)-1)+21
elif int(N)<10**(len(N)-1)*3+1:
    for i in range(10**(len(N)-1)+1,int(N)+1,2):
        j=str(i)
        if "3"in j and "5"in j and "7"in j:
            if len(j)==j.count("3")+j.count("5")+j.count("7"):
                a+=1
    a+=3**(len(N)-1)-3*2**(len(N)-1)+3
print(a)

N = int(input())
def dfs(s):
    if int(s)>N:
        return 0 
    ret = 1 if all(s.count(c)>0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret
print(dfs('0'))

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if int(x) <= N and 3 in x and 5 in x and 7 in x:
    cnt += 1
print(cnt)

N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if int(x) <= N and '3' in x and '5' in x and '7' in x:
    cnt += 1
print(cnt)

N = int(input())
li = ['']
so = 0
for _ in range(9):
  l = len(li)
  for i in range(so, l):
    li.append(li[i] + '3')
    li.append(li[i] + '5')
    li.append(li[i] + '7')
  so = l
cnt = 0
for x in li:
  if '3' in x and '5' in x and '7' in x and int(x) <= N:
    cnt += 1
print(cnt)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
from itertools import product
n=int(input())

ans = 0
for i in range(3, 10):
    for s in product('357', repeat=i):
        if len(set(s)) < 3:
            continue
        753num = int(''.join(s))
        if  753num> n:
            break
        ans += 1
print(ans)


from itertools import product
n=int(input())

ans = 0
for i in range(3, 10):
    for s in product('357', repeat=i):
        if len(set(s)) < 3:
            continue
        num = int(''.join(s))
        if  num > n:
            break
        ans += 1
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
import itertools

N = int(input())

number = [7, 5, 3]

ans = 0
for i in range(10):
    for conv in itertools.product(number, repeat=i+1):
        
        tmp = 0
        for j in range(len(conv)):
            tmp += conv[j] * 10 ** (len(conv) - j - 1)
            
        
        if ((3 in conv) and (5 in conv) and (7 in conv)) and tmp =< N:
            ans += 1
            
        
print(ans)

import itertools

N = int(input())

number = [7, 5, 3]

ans = 0
for i in range(10):
    for conv in itertools.product(number, repeat=i+1):
        
        tmp = 0
        for j in range(len(conv)):
            tmp += conv[j] * 10 ** (len(conv) - j - 1)
            
        
        if ((3 in conv) and (5 in conv) and (7 in conv)) and tmp <= N:
            ans += 1
            
        
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the integers between 1 and N (inclusive), how many _Shichi-Go-San numbers_ (literally "Seven-Five-Three numbers") are there?  Here, a Shichi-Go-San number is a positive integer that satisfies the following condition:    * When the number is written in base ten, each of the digits `7`, `5` and `3` appears at least once, and the other digits never appear.

Submission attempts (in order):
n = int(input())
def dfs(cur, a, b, c):
    if cur == n:
        return 0
    ret = 1 if all(s.count(c)) > 0 for c in "753") else 0
    for i in "753":
        ret += dfs(s+c)
    return ret
print(dfs("0"))

N = int(input())

def dfs(s): 
    print(s)
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs('0')) 

N = int(input())

def dfs(s): 
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs('0')) 

Verdicts: Runtime Error

Wrong Answer

Accepted