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):
text=input()
N=len(text)
high=int(text[0])
ans=0
if high>6:
  ans=3**N-3*(2**N)+3
elif high>4:
  ans=2*(3**(N-1))+2**(N+1)+2
elif high>2:
  ans=3**(N-1)-2**N+1
else:
  ans=3**(N-1)-3*(2**(N-1))+3
for i in range(1,N):
  ans+=3**i-3*(2**i)+3
print(ans)

X=input()
lst = [int(s) for s in list(X)]
N=len(lst)
X=int(X)
ans=0

for i in range(3,N):
  ans+=(3**i-3*(2**i)+3)

ls=[7,5,3]
for i in range(1,N):
  ls_3=[10*s+3 for s in ls]
  ls_5=[10*s+5 for s in ls]
  ls_7=[10*s+7 for s in ls]
  ls=ls_3+ls_5+ls_7
 
def judge(n):
  if n>X:
    return 0
  else:
    if(('3' in str(n))and('5' in str(n))and('7' in str(n))):
      return 1
    else:
      return 0
for t in ls:
  ans+=judge(t)
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()
n_int = int(n)

if n_int<357:
  print(0)
else:
  counter__ = 0
  for k in range(3 ,len(n)+1):
    counter__ += recursive_f([])
    def recursive_f(A):
      if len(A) == k:
        A_ = int("".join(map(str,A)))
        counter = 0
        if len(set(A)) == 3 and A_ <= n_int:
          counter += 1
        return counter
      counter_ = 0
      for i in [3,5,7]:
        A.append(i)
        counter_ += recursive_f(A)
        A.pop()
      return counter_
        
print(counter__)

n=input()           #  str 575
n_int = int(n)    #  int 575

if n_int<357:
    print(0)
else:
    counter__ = 0
    for k in range(3 ,len(n)+1):
        counter__ += recursive_f([])

        def recursive_f(A):
            if len(A) == k:     
                A_ = int("".join(map(str,A)))    
                counter = 0
                # print(A_)
                if len(set(A)) == 3 and A_ <= n_int:
                    counter += 1
                return counter

            counter_ = 0

            for i in [3,5,7]:
                A.append(i)
                counter_ += recursive_f(A)
                A.pop()

            return counter_
        
print(counter__)

n=input()
n_int = int(n)

if n_int<357:
  print(0)
else:
  counter__ = 0
  for k in range(3 ,len(n)+1):
    counter__ += recursive_f([])

    def recursive_f(A):
      if len(A) == k:     
        A_ = int("".join(map(str,A)))    
        counter = 0
        # print(A_)
        if len(set(A)) == 3 and A_ <= n_int:
          counter += 1
          return counter

        counter_ = 0

        for i in [3,5,7]:
          A.append(i)
          counter_ += recursive_f(A)
          A.pop()

          return counter_
        
print(counter__)

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

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())
a = len(str(n))
lst = [[3,5,7]]
tfs = [3,5,7]
for i in range(1,a):
    l = []
    for v in lst[i-1]:
        for t in tfs:
            l.append(int(str(v) + str(t)))
    lst.append(l)
s = 0
for l in lst:
    for v in l:
        if is753(v) and v <= n:
            s+=1
print(s)

def is753(n):
    if n % 10 != 3 and n % 10 != 5 and n % 10 !=7:
        return False
    exist3 = False
    exist5 = False
    exist7 = False
    a = str(n)
    for i in range (len(a)):
        x = n % 10
        if x == 3 :
            exist3 = True
        elif x == 5 :
            exist5 = True
        elif x == 7 :
            exist7 = True
        else :
            return False
        n = n // 10
    if exist3 and exist5 and exist7:
        return True
    else :
        return False

n = int(input())
a = len(str(n))
lst = [[3,5,7]]
tfs = [3,5,7]
for i in range(1,a):
    l = []
    for v in lst[i-1]:
        for t in tfs:
            l.append(int(str(v) + str(t)))
    lst.append(l)
s = 0
for l in lst:
    for v in l:
        if is753(v) and v <= n:
            s+=1
print(s)

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
import collections
n=int(input())
l=len(str(n))
cnt=0
if l<3:
  print(0)
  exit()
for i in range(3,l):
  for k in itertools.product(['7','5','3'],repeat=i):
    j=int(''.join(k))
    c=collections.Counter(k)
    cv=c.values()
    if all(vv!=0 for vv in cv) and j<=n:
      cnt+=1
print(cnt)

import itertools
import collections
n=int(input())
l=len(str(n))
cnt=0
if l<3:
  print(0)
  exit()
for i in range(3,l+1):
  for k in itertools.product(['7','5','3'],repeat=i):
    j=int(''.join(k))
    c=collections.Counter(k)
    cv=c.values()
    if all(vv!=0 for vv in cv) and j<=n:
      cnt+=1
print(cnt)

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

import itertools
import collections
n=int(input())
l=len(str(n))
cnt=0
if l<3:
  print(0)
  exit()
for i in range(3,l+1):
  for k in itertools.product(['7','5','3'],repeat=i):
    j=int(''.join(k))
    k=list(k)
    x=k.count('7')
    y=k.count('5')
    z=k.count('3')
    if all(vv!=0 for vv in [x,y,z]) and j<=n:
      cnt+=1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

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 bfs(s):
  if int(s) >= n:
    return 0
  return ('3' in s and '5' in s and '7' in s) + bfs(s+'3') + bfs(s+'5') + bfs(s+'7')

print(bfs(''))

n = int(input())
 
def bfs(s):
  if int(s) > n:
    return 0
  return ('3' in s and '5' in s and '7' in s) + bfs(s+'3') + bfs(s+'5') + bfs(s+'7')
 
print(bfs('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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# 10 -> n
def ten2n(a,n):
  x=a//n
  y=a%n
  if x:
    return ten2n(x,n)+str(y)
  return str(y)

def main():
  n=I()

  l=[]
  for i in range(pow(4,10)):
    l.append(ten2n(i,4).replace('3','7').replace('2','5').replace('1','3'))

  cnt=0
  for x in l:
    if int(x)<=n:
      if '3' in x and '5' in x and '7' in x and '0' not in x:
        cnt+=1
    else:
      break

  return cnt

print(main())


import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# 10 -> n
def ten2n(a,n):
  x=a//n
  y=a%n
  if x:
    return ten2n(x,n)+str(y)
  return str(y)

def main():
  n=I()

  l=[]
  for i in range(pow(4,9)):
    l.append(ten2n(i,4).replace('3','7').replace('2','5').replace('1','3'))

  cnt=0
  for x in l:
    if int(x)<=n:
      if '3' in x and '5' in x and '7' in x and '0' not in x:
        cnt+=1
    else:
      break

  return cnt

print(main())


Verdicts: Time Limit Exceeded

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): 
return 0
ret = 1 if all(s.count(c) > 0 for c in '753') else 0 
         ret += dfs(s + c)
     return ret
print(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: 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 = input()
l = ['3', '5', '7']
d = len(N)
N = int(N)

if N - 357 < 0:
    print(0)
    exit()


aa = 0
for i in range(3, d):
    aa += 3 ** (d - 1) - 3 * (2 ** (d - 1) - 2) - 3


a = [i for i in itertools.combinations_with_replacement(l, d)]
b = [i for i in a if len(set(i)) == 3]
c = []
for k in b:
    temp = [i for i in itertools.permutations(k)]
    temp = list(set(temp))
    for j in temp:
        c.append(''.join(j))

count = 0
for i in c:
    if int(i) <= N:
        count += 1
        print(i)
print(aa + count)

import itertools

N = input()
l = ['3', '5', '7']
d = len(N)
N = int(N)
aa = 0

if N - 357 < 0:
    print(0)
    exit()
if N > 777777777:
    for i in range(3, d + 1):
        aa += 3 ** i - 3 * (2 ** i - 2) - 3
    print(aa)
    exit()


for i in range(3, d):
    aa += 3 ** i - 3 * (2 ** i - 2) - 3


a = [i for i in itertools.combinations_with_replacement(l, d)]
b = [i for i in a if len(set(i)) == 3]
c = []
count = 0
for k in b:
    temp = list(set([i for i in itertools.permutations(k)]))
    print('here')
    for j in temp:
        if int(''.join(j)) <= N:
            count += 1

print(aa + count)

N = input()
l = ['3', '5', '7']
L = ['3', '5', '7']
temp = []
d = len(N)
N = int(N)


if N - 357 < 0:
    print(0)
    exit()


a = 0
for i in range(3, d):
    a += 3 ** i - 3 * (2 ** i - 2) - 3


for k in range(d - 1):
    for i in L:
        for j in l:
            temp.append(i + j)
    L.clear()
    L.extend(temp)
    temp.clear()
L = [i for i in L if '3' in i and '5' in i and '7' in i]

count = 0
for i in L:
    if int(i) <= N:
        count += 1
print(a + count)

Verdicts: Wrong Answer

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


def main():
  n = int(input())
  
  count_753 = 0
  max_digits = math.ceil(math.log10(n))
  cand_753 = (3, 5, 7)
  
  for digits in range(3, max_digits):
    for dig_753 in itertools.product(cand_753, repeat=digits):
      number_str = "".join(dig_753)
      
      if "7" in number_str and "5" in number_str and "3" in number_str and int(number_str) <= n:
        count_753 += 1
  
  print(count_753)

if __name__ == "__main__":
  main()


import itertools
import math


def main():
  n = int(input())
  
  count_753 = 0
  max_digits = int(math.log10(n)) + 2
  cand_753 = ("3", "5", "7")
  
  for digits in range(3, max_digits):
    for dig_753 in itertools.product(cand_753, repeat=digits):
      number_str = "".join(dig_753)
      
      if "7" in number_str and "5" in number_str and "3" in number_str and int(number_str) <= n:
        count_753 += 1
  
  print(count_753)

if __name__ == "__main__":
  main()


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 sys


from collections import deque
from decorator import stop_watch


@stop_watch
def solve(N):
    dq = deque([(3, [1, 0, 0]), (5, [0, 1, 0]), (7, [0, 0, 1])])
    ans = 0
    while dq:
        num, check = dq.popleft()
        if num > N:
            break
        if sum(check) == 3:
            ans += 1
        for i in (3, 5, 7):
            new_num = num * 10 + i
            if new_num > N:
                break
            new_check = check.copy()
            if i == 3:
                new_check[0] = 1
            elif i == 5:
                new_check[1] = 1
            elif i == 7:
                new_check[2] = 1
            dq.append((new_num, new_check))
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

    # # test
    # from random import randint
    # from func import random_str
    # solve()


# import sys


from collections import deque


# from decorator import stop_watch
#
#
# @stop_watch
def solve(N):
    dq = deque([(3, {3: 1, 5: 0, 7: 0}),
                (5, {3: 0, 5: 1, 7: 0}),
                (7, {3: 0, 5: 0, 7: 1})])
    ans = 0
    while dq:
        num, check = dq.popleft()
        if num > N:
            break
        if sum(check.values()) == 3:
            ans += 1
        for i in (3, 5, 7):
            new_num = num * 10 + i
            if new_num > N:
                break
            new_check = check.copy()
            new_check[i] = 1
            dq.append((new_num, new_check))
    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

    # # test
    # from random import randint
    # from func import random_str
    # solve()


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):
# coding: utf-8
# Your code here!
import itertools
x = int(input())
l = [3, 5, 7]

h = itertools.combinations_with_replacement(l, 4)

cnt = 0
for v in itertools.combinations_with_replacement(l, 4):
    if (3 in v and 5 in v and 7 in v):
        if v < x:
            cnt += 1

h_list = list(itertools.combinations_with_replacement(l, 4))

print (cnt)

import itertools
x = int(input())
l = [3, 5, 7]


cnt = 0
for i in range(2, len(str(x))+1):
    for v in itertools.combinations_with_replacement(l, i):
        #print(v)
        if (3 in v and 5 in v and 7 in v):
            num = ""
            for text in v:
                num += str(text)
            anagram_list = [''.join(v) for v in itertools.permutations(num)]
            anagram_list =  list(set(anagram_list))
            print (anagram_list)
            for hoge in anagram_list:
                if int(hoge) < x:
                    cnt += 1
                    #print(hoge)

print (cnt)

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
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()
t = ["3","5","7"]
for i in range(8):
    s = []
    for j in t:
        s.append(j+"3")
        s.append(j+"5")
        s.append(j+"7")
    t += s
t = set(t)
t = list(t)
t.sort()
count = 0
for i in range(len(t)):
    if len(t[i]) > len(n):
        break
    if int(t[i]) > int(n):
        continue
    if '3' in t[i] and '5' in t[i] and '7' in t[i]:
        count+=1
print(count)

n = input()
t = ["3","5","7"]
for i in range(8):
    s = []
    for j in t:
        s.append(j+"3")
        s.append(j+"5")
        s.append(j+"7")
    t += s
t = set(t)
t = list(t)
t.sort()
count = 0
for i in range(len(t)):
    if len(t[i]) > len(n):
        continue
    if int(t[i]) > int(n):
        continue
    if '3' in t[i] and '5' in t[i] and '7' in t[i]:
        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):
def f4(n):
  s=0
  d=1
  q=0
  while n>0:
    s+=d*(n%4)
    d*=10
    n=n//4
  return s

n=input()
d=len(n)
if d>3 and n[0:2] in ['11','12','21','22']:
  d-=1
  n='7'*d
ans=0
m=''
for i in range(d):
  x=n[i]
  if x in '12':
    m+='0'
  elif x in '34':
    m+='1'
  elif x in '56':
    m+='2'
  else:
    m+='3'
ans=0
for i in range(1,1+int(m,4)):
  l=[x for x in str(f4(i))]
  l=list(set(l))
  if len(l)==3 and 6==int(l[0])+int(l[1])+int(l[2]):
    ans+=1

print(m,ans)

def f4(n):
  s=0
  d=1
  q=0
  while n>0:
    s+=d*(n%4)
    d*=10
    n=n//4
  return s

n=input()
d=len(n)
if d>3 and n[0] in ['1','2']:
  d-=1
  n='7'*d
ans=0
m=''
for i in range(d):
  x=n[i]
  if x in '12':
    m+='0'
  elif x in '34':
    m+='1'
  elif x in '56':
    m+='2'
  else:
    m+='3'
ans=0
for i in range(1,1+int(m,4)):
  l=[x for x in str(f4(i))]
  l=list(set(l))
  if len(l)==3 and 6==int(l[0])+int(l[1])+int(l[2]):
    ans+=1

print(m,ans)

from collections import deque

n = int(input())
q = deque(['3','5','7'])
ans = 0
l = []
while True:
    v = q.popleft()
    if int(v) >= n:
        if int(v) == n and ('3' in v and '5' in v and '7' in v):
            ans += 1
        print(ans)
        exit() 
    if '3' in v and '5' in v and '7' in v:
        ans += 1
        l.append(int(v))
    q.append(v+'3')
    q.append(v+'5')
    q.append(v+'7')

Verdicts: Wrong Answer

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 sys

n = int(input())
sys.setrecursionlimit(10**10)



def count(num):
    if num > n:
        return 0
    fl = 0
    s = str(num)
    if '3' in s and '5' in s and '7' in s:
        fl = 1

    return fl + count(num*10+3) + count(num*10+5) + count(num*10+7)


print(count(0))

import sys

n = int(input())
sys.setrecursionlimit(2*10**9+1)


def count(num):
    if num > n:
        return 0
    fl = 0
    s = str(num)
    if '3' in s and '5' in s and '7' in s:
        fl = 1

    return fl + count(num*10+3) + count(num*10+5) + count(num*10+7)


print(count(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 = 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())

cnt = 0
def dfs(n):
    global cnt
    if len(n) >= 11:
        return 0
    for s in '357':
        dfs(n+s)
    if int(n) <= N and '3' in n and '5' in n and '7' in n:
        cnt += 1
    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):
N = input()
def rec(list1,list2,initial,time):
    for e in list1:
        for b in [0,1,2,3]:
            if b == 0:
                e_copy = e
                list2.append(e_copy)
            elif b == 1:
                e_copy = e + "3"
                list2.append(e_copy)
            elif b == 2:
                e_copy = e + "5"
                list2.append(e_copy)
            elif b == 3:
                e_copy = e + "7"
                list2.append(e_copy)
    list1.clear()
    
    if initial + 1 >= time :
        return list2
    else:
        return rec(list2,list1,initial + 1, time)
l1 = ["3","5","7"]
l2 = []
result = rec(l1,l2,0,len(N)-2)
result = [int(e) for e in result if e.count("3")*e.count("5")*e.count("7") >= 1]
result = list(set(result))
result.sort()
count = 0
for e in result:
    if int(N) < e:
        break
    count += 1
print(count)

N = int(input())
ans = 0
def dfs(s):
    if int(s) <= N and len(set(s)) >= 3:
        global ans
        ans += 1

    if len(s) == 9:
        return
    dfs(s + "7")
    dfs(s + "5")
    dfs(s + "3")

dfs("7")
dfs("5")
dfs("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):
def is_753(s) :
	if (s.find("0") > -1) :
		return False
	elif (s.find("1") > -1) :
		return False
	elif (s.find("2") > -1) :
		return False
	elif (s.find("4") > -1) :
		return False
	elif (s.find("6") > -1) :
		return False
	elif (s.find("8") > -1) :
		return False
	elif (s.find("9") > -1) :
		return False
	return True

N = int(input())
count = 0
# index = 0

for i in range(N+1) :
	s = str(i)
	if (is_753(s)) :
		count += 1

print(count)

import math
def is_753(s) :
	
	if ("0" in s) :
		return False
	elif ("1" in s) :
		return False
	elif ("2" in s) :
		return False
	elif ("4" in s) :
		return False
	elif ("6" in s) :
		return False
	elif ("8" in s) :
		return False
	elif ("9" in s) :
		return False
	
	if ("7" in s and "5" in s and "3" in s) :
		return True
	
	return False

def hoge(s) :
	for i in range(len(s)) :
		if (s[i] != "3" and s[i] != "5" and s[i] != "7") :
			return int(math.pow(10, len(s) - (i+1)))

	return 0

def main() :
	N = int(input())
	count = 0
	index = 356
	
	if (N < 357) :
		print("0")
		return

	while index <= N :
		s = str(index)
		a = hoge(s)
		if (a != 0) :
			index += a
			continue		
		
		if (is_753(s)) :
			count += 1
		
		index += 1
	
	print(count)


main()

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

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

e=[0 for i in range(n)]
for i in range(2,n):
  for j in range(2,i):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k:
      ret += 1
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

n=int(input())
e=[0 for i in range(n+1)]
for i in range(2,n+1):
  for j in range(2,i+1):
    if i==1:
      break
    while i%j==0:
      i//=j
      e[j]+=1

def num(k):
  ret=0
  for i in range(n):
    if e[i]>=k-1:
      ret += 1
  return ret
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
from collections import Counter

def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    if x!=1:
      retlist.append(x)
    return retlist

N=int(input())

cnt=Counter()
for i in range(N):
  a=get_factors(i+1)
  acounter=Counter(a)
  cnt=cnt+acounter
values,counts=zip(*cnt.most_common())
ans=0
five=0
three=0
sevfou=0
twofou=0
fourteen=0
for c in counts:
  if c>=74:
    sevfou+=1
  if c>=24:
    twofou+=1
  if c>=14:
    fourteen+=1
  if c>=4:
    five+=1
  if c>=2:
    three+=1
ans+=(five*(five-1)/2)*(three-2)
ans+=(fourteen*(five-1))
ans+=(twofou*(three-1))
ans+=(sevfou)
print(ans)

from collections import Counter

def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    if x!=1:
      retlist.append(x)
    return retlist

N=int(input())

if N==1:
  print(0)
  exit()

cnt=Counter()
for i in range(N):
  a=get_factors(i+1)
  acounter=Counter(a)
  cnt=cnt+acounter
values,counts=zip(*cnt.most_common())
ans=0
five=0
three=0
sevfou=0
twofou=0
fourteen=0
for c in counts:
  if c>=74:
    sevfou+=1
  if c>=24:
    twofou+=1
  if c>=14:
    fourteen+=1
  if c>=4:
    five+=1
  if c>=2:
    three+=1
ans+=(five*(five-1)/2)*(three-2)
ans+=(fourteen*(five-1))
ans+=(twofou*(three-1))
ans+=(sevfou)
print(int(ans))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
# encoding:utf-8
import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())


def factorint(N):

    table = []
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    table.append(i)
                break
    # print(table_)
    return table

l = []
for n in range(1,N+1):
    l += factorint(n)
# print(l)
c = collections.Counter(l)
# print(c)
c[1] = 0
ans = 0
com = {74:0,24:0,4:0,2:0,14:0}
for key in c.keys():
    if c[key] >= 74:
        com[74] = +1
    if c[key] >= 24:
        com[24] = +1
    if c[key] >= 14:
        com[14] += 1
    if c[key] >= 4:
        com[4] += 1
    if c[key] >= 2:
        com[2] += 1
print(com)
ans += com[74]
ans += com[24] * (com[2] - com[24])
ans += com[14] * (com[14] - com[2])
if com[4] >= 2:
    ans += com[4] * (com[4] - 1)//2 * (com[2] - 2)
print(ans)


# encoding:utf-8
import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())


def factorint(N):

    table = []
    while(N > 1):
        for i in range(2,N+1):
            if N%i == 0:
                while N%i == 0:
                    N = N//i
                    table.append(i)
                break
    return table

l = []
for n in range(1,N+1):
    l += factorint(n)
c = collections.Counter(l)
com = {74:0,24:0,14:0,4:0,2:0}
# print(c)
for key in c.keys():
    if c[key] >= 74:
        com[74] += 1
    if c[key] >= 24:
        com[24] += 1
    if c[key] >= 14:
        com[14] += 1
    if c[key] >= 4:
        com[4] += 1
    if c[key] >= 2:
        com[2] += 1
# print(com)
ans = 0
ans += com[74]
ans += com[24] * (com[2] - 1)
ans += com[14] * (com[4] - 1)
ans += com[4] * (com[4] - 1)* (com[2] - 2) //2
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

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

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: x >= m-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)


n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: x >= m-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)


n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: m-1 =< x, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)


n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] == 1

def num(s):
  return len(list(filter(lambda x: m-1 > x, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)

n = int(input())

l = [0]*(n+1)
for i in range(2, n+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      cur //= j
      l[j] += 1

def num(s):
  return len(list(filter(lambda x: x >= s-1, l)))

print(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)//2)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
from itertools import permutations

n=int(input())
np=factorial(n)
p_list=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

ans=[]
for s,t,u in permutations(p_list,3):
  num1=(s**4)*(t**4)*(u**2)
  num2=(s**14)*(t**4)
  num3=(s**24)*(t**2)
  num4=s**74
  for z in [num1,num2,num3,num4]:
    if np%z==0:
      ans.append(z)

print(len(set(ans)))

from collections import Counter
from itertools import permutations

n=int(input())

def factorization(n):
    p=2
    fcr=[]
    while p*p<=n:
        while n%p==0:
            fcr.append(p)
            n//=p
        p+=1
    if n>1:
        fcr.append(n)
    return fcr


fcr_l=[]
for i in range(1,n+1):
  fcr=factorization(i)
  fcr_l+=fcr


c=Counter(fcr_l)
fcr_st=set(fcr_l)

ans=[]
for p,q,r in permutations(fcr_st,3):
  if c[p]>=74:
    ans.append(p**74)
  if c[p]>=24 and c[q]>=2:
    ans.append((p**24)*(q**2))
  if c[p]>=14 and c[q]>=4:
    ans.append((p**14)*(q**4))
  if c[p]>=4 and c[q]>=4 and c[r]>=2:
    ans.append((p**4)*(q**4)*(r**2))

print(len(set(ans)))

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
n=int(input())
f=[]
w=[0,0,0,0,0]
for i in range(2,n+1):
    c=0
    r=int(i**0.5)
    for j in range(2,r+2):
        while i%j==0:
            c+=1
            i=i//j
        if c!=0:
            f.append([j,c])
            c=0
    if i!=1:
        f.append([i,1])
f.sort()
d=[]
ans=0
cou=f[0][1]
for i in range(1,len(f)):
    if f[i][0]==f[i-1][0]:
        cou+=f[i][1]
    else:
        d.append(cou)
        cou=1
d.append(cou)

for i in d:
    for j,num in enumerate([2,4,14,24,74]):
        if i>=num:
            w[j]+=1
print(w)
print(w[4]+w[3]*(w[0]-1)+w[2]*(w[1]-1)+w[1]*(w[1]-1)*(w[0]-2)//2)

n=int(input())
f=[]
w=[0,0,0,0,0]
for i in range(2,n+1):
    c=0
    r=int(i**0.5)
    for j in range(2,r+2):
        while i%j==0:
            c+=1
            i=i//j
        if c!=0:
            f.append([j,c])
            c=0
    if i!=1:
        f.append([i,1])
f.sort()
d=[]
ans=0
if n!=1:
    cou=f[0][1]
    for i in range(1,len(f)):
        if f[i][0]==f[i-1][0]:
            cou+=f[i][1]
        else:
            d.append(cou)
            cou=1
    d.append(cou)

    for i in d:
        for j,num in enumerate([2,4,14,24,74]):
            if i>=num:
                w[j]+=1
    ans=w[4]+w[3]*(w[0]-1)+w[2]*(w[1]-1)+w[1]*(w[1]-1)*(w[0]-2)//2
print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
def D():
    N = int(input())
    tmplist = [0 for i in range(N + 1)]
    for i in range(1, N + 1):
        key = i
        for j in range(2, key + 1):
            while i % j == 0:
                tmplist[j] += 1
                i /= j
    ans = 0
    anslist = []
    for p in range(N + 1):
        if tmplist[p] + 1 >= 75:
            anslist.append(pow(p, 74))
        for q in range(N + 1):
            if p != q and tmplist[p] + 1 >= 25 and tmplist[q] + 1 >= 3:
                anslist.append(pow(p, 24) * pow(q, 2))
            if p != q and tmplist[p] + 1 >= 15 and tmplist[q] + 1 >= 5:
                anslist.append(pow(p, 14) * pow(q, 4))
            for r in range(N + 1):
                if p != q and q != r and r != p and tmplist[p] + 1 >= 5 and tmplist[q] + 1 >= 5 and tmplist[r] + 1 >= 3:
                    anslist.append(pow(p, 4) * pow(q, 4) * pow(r, 2))
    anslist.sort()
    ans = 1
    for i in range(1, len(anslist)):
        if anslist[i] != anslist[i - 1]:
            ans += 1
    print(ans)

D()

def D():
    N = int(input())
    numberlist = [0 for i in range(N + 1)]
    for i in range(1, N + 1):
        tmp = i
        for j in range(2, i + 1):
            while tmp % j == 0:
                numberlist[j] += 1
                tmp /= j
    anslist = []
    for p in range(N + 1):
        if numberlist[p] + 1 >= 75:
            anslist.append(pow(p, 74))
        for q in range(N + 1):
            if p != q and numberlist[p] + 1 >= 15 and numberlist[q] + 1 >= 5:
                anslist.append(pow(p, 14) * pow(q, 4))
            if p != q and numberlist[p] + 1 >= 25 and numberlist[q] + 1 >= 3:
                anslist.append(pow(p, 24) * pow(q, 2))
            for r in range(N + 1):
                if p != q and q != r and r != p and numberlist[p] + 1 >= 5 and numberlist[q] + 1 >= 5 and numberlist[r] + 1 >= 3:
                    anslist.append(pow(p, 4) * pow(q, 4) * pow(r, 2))
    ans = 1
    anslist.sort()
    for i in range(1, len(anslist)):
        if anslist[i] != anslist[i - 1]:
            ans += 1
    if len(anslist) == 0:
        ans = 0
    print(ans)
D()

Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
n = int(input())
d = []
e = [0,0,0,0,0]
f = [74,24,14,4,2]
for i in prime_list:
  a = n
  b = 0
  c = 1
  while a // (i**c) > 0:
    b += a // (i**c)
    c += 1
  else:
    d.append(b)
count = 0
len_d = len(d)-1
for k in f:
  for i,j in enumerate(d):
    if j < k:
      e[count] = i
      count += 1
      break
    elif i == len_d:
      e[count] = i+1
      count += 1
      break


print(e[0]+e[1]*(e[4]-1)+e[2]*(e[3]-1)+(e[3]*(e[3]-1)//2)*(e[4]-2))


d = []
e = [0,0,0,0,0]
f = [74,24,14,4,2]
for i in prime_list:
  a = n
  b = 0
  c = 1
  while a // (i**c) > 0:
    b += a // (i**c)
    c += 1
  else:
    d.append(b)
count = 0
len_d = len(d)-1
for k in f:
  for i,j in enumerate(d):
    if j < k:
      e[count] = i
      count += 1
      break
    elif i == len_d:
      e[count] = i+1
      count += 1
      break


print(e[0]+e[1]*(e[4]-1)+e[2]*(e[3]-1)+(e[3]*(e[3]-1)//2)*(e[4]-2))

n = int(input())
prime_list = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47]
d = []
e = [0,0,0,0,0]
f = [74,24,14,4,2]
for i in prime_list:
  a = n
  b = 0
  c = 1
  while a // (i**c) > 0:
    b += a // (i**c)
    c += 1
  else:
    d.append(b)
count = 0
len_d = len(d)-1
for k in f:
  for i,j in enumerate(d):
    if j < k:
      e[count] = i
      count += 1
      break
    elif i == len_d:
      e[count] = i+1
      count += 1
      break



print(e[0]+e[1]*(e[4]-1)+e[2]*(e[3]-1)+(e[3]*(e[3]-1)//2)*(e[4]-2))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
def is_prime(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1 << 32 else [2, 3, 5, 7, 11, 13, 17] if n < 1 << 48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1:
            continue
        while y != n - 1:
            y = y * y % n
            if y == 1 or t == n - 1: return 0
            t <<= 1
    return 1


def prime_factor(n):
    if n == 1:
        return {1: 1}

    pf = dict()
    r = list(range(2, n + 1))

    while n != 1:
        x = r[0]
        cnt = 0
        while n % x == 0:
            n = n // x
            cnt += 1
        if cnt > 0:
            pf[x] = cnt
        r = list(filter(lambda y: y % x != 0, r))

    return pf


def main():
    from fractions import factorial as f
    from collections import defaultdict
    n = int(input())
    d = defaultdict(int)
    for i in range(1, n + 1):
        p = prime_factor(i)
        for k, v in p.items():
            d[k] += v
    
    f2_, f4_, f14_, f24_, f74_ = 0, 0, 0, 0, 0
    for i in d.values():
        if i >= 2:
            f2_ += 1
        if i >= 4:
            f4_ += 1
        if i >= 14:
            f14_ += 1
        if i >= 24:
            f24_ += 1
        if i >= 74:
            f74_ += 1

    ans = f74_ + f24_ * (f2_ - 1) + f14_ * (f4_ - 1) + f4_ * (f4_ - 1) * (f2_ - 2) // 2
    print(ans)


if __name__ == '__main__':
    main()


def is_prime(n):
    d = n - 1
    d = d // (d & -d)
    L = [2, 7, 61] if n < 1 << 32 else [2, 3, 5, 7, 11, 13, 17] if n < 1 << 48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1:
            continue
        while y != n - 1:
            y = y * y % n
            if y == 1 or t == n - 1: return 0
            t <<= 1
    return 1


def prime_factor(n):
    if n == 1:
        return {1: 1}

    pf = dict()
    r = list(range(2, n + 1))

    while n != 1:
        x = r[0]
        cnt = 0
        while n % x == 0:
            n = n // x
            cnt += 1
        if cnt > 0:
            pf[x] = cnt
        r = list(filter(lambda y: y % x != 0, r))

    return pf


def main():
    from collections import defaultdict
    n = int(input())
    d = defaultdict(int)
    for i in range(1, n + 1):
        p = prime_factor(i)
        for k, v in p.items():
            d[k] += v
    
    f2_, f4_, f14_, f24_, f74_ = 0, 0, 0, 0, 0
    for i in d.values():
        if i >= 2:
            f2_ += 1
        if i >= 4:
            f4_ += 1
        if i >= 14:
            f14_ += 1
        if i >= 24:
            f24_ += 1
        if i >= 74:
            f74_ += 1

    ans = f74_ + f24_ * (f2_ - 1) + f14_ * (f4_ - 1) + f4_ * (f4_ - 1) * (f2_ - 2) // 2
    print(ans)


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]
tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))
print(tmp_array)

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 14 and tmp[j] >= 4) or (tmp[i] >= 4 and tmp[j] >= 14):
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif (tmp[i] >= 24 and tmp[j] >= 2) or (tmp[i] >= 2 and tmp[j] >= 24):
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i, j, k in res_array:
    if (tmp[i] >= 2 and tmp[j] >= 4 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 2 and tmp[k] >= 4) or \
            (tmp[i] >= 4 and tmp[j] >= 4 and tmp[k] >= 2):
        cnt += 1
print(cnt)


import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]

tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 14 and tmp[j] >= 4:
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 24 and tmp[j] >= 2:
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i in range(len(tmp_array)):
    for j in range(len(tmp_array)):
        for k in range(j+1, len(tmp_array)):
            if (j == i) or (i == k): continue
            if tmp[tmp_array[i]] >= 2 and tmp[tmp_array[j]] >= 4 and tmp[tmp_array[k]] >= 4:
                cnt += 1

print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there?  Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.

Submission attempts (in order):
import math
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]

M = N
fac_lst = []
for i in prime:
    count = 0
    M = N
    while M % i == 0:
        M = M // i
        count += 1
    fac_lst.append(count)
    
count0, count1, count2, count3, count4 = 0, 0, 0, 0,0
for i in fac_lst:
    if i >= 74:
        count0 += 1
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 24:
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 14:
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 4:
        count3 += 1
        count4 += 1
    elif i >= 2:
        count4 += 1
count_lst = [count0, count1, count2, count3, count4]

ans0 = count_lst[0]
ans1 = count_lst[1] * (count_lst[4] - 1)
ans2 = count_lst[2] * (count_lst[3] - 1)
ans3 = (count_lst[3]*(count_lst[3]-1) // 2) * (count_lst[4] - 2)
if ans1 < 0:
    ans1 = 0
if ans2 < 0:
    ans2 = 0
if ans3 < 0:
    ans3 = 0
print(ans0+ans1+ans2+ans3)

import math
prime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]

n = int(input())
N = math.factorial(n)

M = N
fac_lst = []
for i in prime:
    count = 0
    M = N
    while M % i == 0:
        M = M // i
        count += 1
    fac_lst.append(count)
    
count0, count1, count2, count3, count4 = 0, 0, 0, 0,0
for i in fac_lst:
    if i >= 74:
        count0 += 1
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 24:
        count1 += 1
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 14:
        count2 += 1
        count3 += 1
        count4 += 1
    elif i >= 4:
        count3 += 1
        count4 += 1
    elif i >= 2:
        count4 += 1
count_lst = [count0, count1, count2, count3, count4]

ans0 = count_lst[0]
ans1 = count_lst[1] * (count_lst[4] - 1)
ans2 = count_lst[2] * (count_lst[3] - 1)
ans3 = (count_lst[3]*(count_lst[3]-1) // 2) * (count_lst[4] - 2)
if ans1 < 0:
    ans1 = 0
if ans2 < 0:
    ans2 = 0
if ans3 < 0:
    ans3 = 0
print(ans0+ans1+ans2+ans3)

Verdicts: Runtime Error

Accepted