TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):

def main():

    N = int(input())

    if N == 3 or N== 5 or N == 7:
        print("Yes")
    else:
        print("No")
    


if __name__== "__main__":
    main() 


def main():

    N = int(input())

    if N == 3 or N== 5 or N == 7:
        print("YES")
    else:
        print("NO")
    


if __name__== "__main__":
    main() 

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
#include <stdio.h>

int main() {
  int X;
  scanf("%d", &X);
  
  if (X == 3) {
    printf("YES");
  } else if (X == 5) {
    printf("YES");
  } else if (X == 7) {
    printf("YES");
  } else {
    printf("NO");
  }
  
  return 0;
  
}


if int(input()) in [3, 5, 7]:
  print('YES')
else:
  print('NO')

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
str1=input('年齢')
num=int(str1)
if num==3 or num==5 or num==7:
    print('YES')
else:
    print('NO')


str1=input('年齢')
num=int(str1)
if num==3 and num==5 and num==7:
    print('YES')
else:
    print('NO')


str1=input('')
num=int(str1)
if num==3 or num==5 or num==7:
    print('YES')
else:
    print('NO')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
def age_check(age):
  if age == 3 or age == 5 or age == 7:
    print('YES')
  else:
    print('NO')

def age_check(age):
  if age ==3:
    print('YES')
  elif age ==5:
    print('YES')
  elif age == 7:
    print('YES')
  else:
    print('NO')
 
age = input()
 
age_check(age) 

def age_check(age):
    if age ==3:
        print('YES')
    else age == 5:
        print('YES')
    else age == 7:
        print('YES')
    else:
        print('NO')

age = input()

age_check(age) 

def age_check(age):
  if age ==3:
    print('YES')
  else age == 5:
    print('YES')
  else age == 7:
    print('YES')
  else:
    print('NO')

age = input()

age_check(age) 


def age_check(age):
  if age == 3 or age == 5 or age == 7:
    print('YES')
  else:
    print('NO')
 
age = int(input())
 
age_check(age) 

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
print('YES' if int(input) in [3,5,7] else 'NO')

print('YES' if int(input()) in [3,5,7] else 'NO')


Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

if X == 7 or 5 or 3:
    print("Yes")
else:
    print("No")

X = int(input())

if X == 7 or X == 5 or X == 3:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X=int(input())
if X== 3,5, 7:
  print("YES")
else:
  print("NO")


X=int(input())
if X== 3 or X==5 or X==7:
  print("YES")
else:
  print("NO")


Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X=input()
if X in "753":
  "YES"
else:
  "NO"

X=input()
if X in "753":
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input("name?\n"))

if x == 3 or x == 5 or x == 7:
	print("YES")
else:
	print("NO")

x = int(input())

if x == 3 or x == 5 or x == 7:
	print("YES")
else:
	print("NO")


Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X = int(input())
if X == 3 or X == 5 or X == 7:
  print("YES)
else:
  print("NO")

X = int(input())
if X == 3 or X == 5 or X == 7:
  print("YES")
else:
  print("NO")


Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

l = [3,5,7]
if INT() in l:
    print("Yes")
else:
    print("No")

def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

l = [3,5,7]
if INT() in l:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
print("YNEOS"[1-input()in"357"::2])

print("YES"if input()in"357"else"NO")

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
d = int(input())
if d == 3 or d== 5 or d==7:
	print("YES")
else
	print("NO")	

d = int(input())
if d == 3 or d== 5 or d==7:
 print("YES")
else:
 print("NO")	

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

ans = "No"
if (X == 3 or X == 5 or X == 7):
  ans = "Yes"
print(ans)

X = int(input())

ans = "NO"
if (X == 3 or X == 5 or X == 7):
  ans = "YES"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
n = int(input())
if n == 7 or n == 5 or n == 3:
    print(YES)
else:
    print(NO)

n = int(input())
if n == 7 or n == 5 or n == 3:
  print(YES)
else:
  print(NO)

n = int(input())
if n == 7 or n == 5 or n == 3:
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X = int(input())
if 1<= X and X <= 9:
    print('NO')
else:
    print('NO')

X = int(input())
if X == 3 or X == 5 or X ==7:
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
n = int(input())
if n == 3 or n == 5 or n == 7:
    print("Yes")
else:
    print("No")

n = int(input())
if n == 3 or n == 5 or n == 7:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
s = input()
koho = []
for i in range(len(s)-2):
    S = int(s[i:i+3])
    sa = abs(S - 753)
    koho.append(sa)
print(min(koho))

X = int(input())
if X == 7 or X == 5 or X == 3:
    print('YES')
else:
    print('NO')

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

x=map(int,input().split(' '))
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')

x=int(input())
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
N = int(input())
if N in [7,5,3]:
    print('Yes')
else:
    print('No')


N = input()
if N in ['7','5','3']:
    print('YES')
else:
    print('NO')


Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
y=[3,5,7]
x=int(input())
if x in y:
    print("祝ってやる")
else:
    print("呪ってやる")


y=[3,5,7]
x=int(input())
if x in y:
    print("YES")
else:
    print("NO")


Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X=int(input())
if X==(7 or 5 or 3):
  print('YES')
else:
  print('NO')

X=int(input())
p=[3,5,7]
if X in p:
  print('YES')
else:
  print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
n = int(input())
if n == 7 or n == 5 or n == 3:
    print('Yes')
else:
    print('No')


n = int(input())
if n == 7 or n == 5 or n == 3:
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input())
if x =3 or x = 5 or x = 7:
  print('YES')
else:
  print('NO')

a = int(input())
if a ==3 or a==5 or a ==7:
    ans = 'YES'
else:
    ans = 'NO'

print(ans)

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if (n == 3)or(n == 5)or(n == 7):
    print("YES")
  else:
    print("NO")
    
print("{}".format(f(X)))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if (n = 3) or (n = 5)or (n = 7):
    print("YES")
  else:
    print("NO")
    
print("{}".format(f(X)))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if n == 3,5,7:
    print("YES")
  else:
    print("NO")
    
print("{}".format(f(X)))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
X = int(input())
def f(n):
  if (n == 3)or(n == 5)or(n == 7):
    return "YES"
  else:
    return "NO"
    
print("{}".format(f(X)))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x=int(input())
if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')


x=input()
'''if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')
'''
if x in [7,5,3]:
    print('YES')
else:
    print('NO')


x=int(input())
if x in [7,5,3]:
    print('Yes')
else:
    print('No')


x=int(input())
'''if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')
'''
if x in [7,5,3]:
    print('Yes')
else:
    print('No')


x=int(input())
'''if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')
'''
if x in [7,5,3]:
    print('Yes')
else:
    print('No')


x=int(input())
'''if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')
'''
if x in [7,5,3]:
    print('YES')
else:
    print('NO')



Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
def main114():
    import numpy as np

    S = input()
    answer = 0

    digit1 = []
    digit2 = []
    digit3 = []

    for i in range(len(S)):
        digit1.append(abs(7 - int(S[i])))
        digit2.append(abs(5 - int(S[i])))
        digit3.append(abs(3 - int(S[i])))

    first = [i for i, x in enumerate(digit1) if x == min(digit1) and i < len(digit1) - 2]

    if len(first) == 1:
        answer = int(S[first[0]]) * 100 + int(S[first[0] + 1]) * 10 + int(S[first[0] + 2])

    elif len(first) > 1:
        digit2_new = []
        for i in range(len(first)):
            digit2_new.append(digit2[first[i] + 1])

        second = [i for i, x in enumerate(digit2) if x == min(digit2_new) and i < len(digit2) - 1]
        if len(second) == 1:
            answer = int(S[first[0]]) * 100 + int(S[second[0]]) * 10 + int(S[second[0] + 1])
        elif len(second) > 1:
            digit3_new = []
            for i in range(len(second)):
                digit3_new.append(digit3[second[i] + 1])

            third = [i for i, x in enumerate(digit3) if x == min(digit3_new) and i < len(digit3)]
            answer = int(S[first[0]]) * 100 + int(S[second[0]]) * 10 + int(S[third[0]])

    answer = abs(753 - answer)
    print(answer)


main114()

import numpy as np

S = input()
answer = 0

digit1 = []
digit2 = []
digit3 = []

for i in range(len(S)):
    digit1.append(abs(7 - int(S[i])))
    digit2.append(abs(5 - int(S[i])))
    digit3.append(abs(3 - int(S[i])))

first = [i for i, x in enumerate(digit1) if x == min(digit1) and i < len(S) - 2]

if len(first) == 1:
    answer = int(S[first[0]]) * 100 + int(S[first[0] + 1]) * 10 + int(S[first[0] + 2])

elif len(first) > 1:
    digit2_new = []
    for i in range(len(first)):
        digit2_new.append(digit2[first[i] + 1])

    second = [i for i, x in enumerate(digit2) if x == min(digit2_new) and i < len(S) - 1]
    if len(second) == 1:
        answer = int(S[first[0]]) * 100 + int(S[second[0]]) * 10 + int(S[second[0] + 1])
    elif len(second) > 1:
        digit3_new = []
        for i in range(len(second)):
            digit3_new.append(digit3[second[i] + 1])

        third = [i for i, x in enumerate(digit3) if x == min(digit3_new) and i < len(S)]
        answer = int(S[first[0]]) * 100 + int(S[second[0]]) * 10 + int(S[third[0]])

answer = abs(753 - answer)
print(answer)

X = int(input())

if X == 3 or X == 5 or X == 7:
    print("YES")

else:
    print('NO')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
n=[int(input()) for i in range(int(input()))]
print(sum(n) - max(n)//2)

print('YES' if input() in ['3', '5', '7'] else 'NO')

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = input()
if x==3 or x==5 or x==7:
  print("YES")
else:
  print("NO")


X = input()
if X=3 or X=5 or X=7:
  print("YES")
else:
  print("NO")


X = int(input())
if X=3 or X=5 or X=7:
  print("YES")
else:
  print("NO")

X = int(input())
if x=3 or X=5 or x=7:
  print("YES")
else:
  print("NO")

x = int(input())
if x==3 or x==5 or x==7:
  print("YES")
else:
  print("NO")


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
l=[3,5,7]
print("Yes" if int(input()) in l else "No" )

l=[3,5,7]
print("YES" if int(input()) in l else "NO" )

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X = int(input())
if X == 7 or X== 5 or X== 3:
    print('Yes')
else:
    print('NO')

X = int(input())
if X == 7 or X== 5 or X== 3:
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
s=input()
imin=753
for i in range(len(s)-2):
	if abs(int(s[i]+s[i+1]+s[i+2])-753)<imin:
		imin=abs(int(s[i]+s[i+1]+s[i+2])-753)
print(imin)

x=int(input())
if x==3:
	print("Yes")
elif x==5:
	print("Yes")
elif x==7:
	print("Yes")	
else:	
	print("No")

x=int(input())
if x==3:
	print("YES")
elif x==5:
	print("YES")
elif x==7:
	print("YES")	
else:	
	print("NO")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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('0')) 


# 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):
        num = v[0]+v[1]+v[2]+v[3]
        if int(num) < x:
            cnt += 1

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

print (cnt)

x = int(input())
if (x == 7 or x == 5 or x==3):
	print ('YES')
else:
	print ('NO')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
y=int(input())
if y==7 or y==5 0r y==3:
  print("YES")
else:
  print("NO")

y=int(input())
if y==7 or y==5 or y==3:
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input())
y = str(x)

sa = None

for i in range(len(y) - 2):
    z = str(x)[i:3+i]
    bbb = abs(int(z) - 753)

    if not sa:
        sa = bbb
    
    if sa > bbb:
        sa = bbb

print(sa)

x = int(input())
y = str(x)

if x == 3 or x == 5 or x == 7 :
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
print('NYoe s'[input()in'357'::2])

print('NYOE S'[input()in'357'::2])

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
s=list(map(str,input()))
#print(s)
s_3=[]
for i in range(len(s)-2):
  a=''.join(s[i:(i+3)])
  #print(a)
  s_3.append(abs(int(a)-753))
print(min(s_3))

if(int(input())==(3 or 5 or 7)):
  print('YES')
else:print('NO')

a=int(input())
if(a==3 or a==5 or a==7):
  print('YES')
else:print('NO')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
# Title: close to 753


import sys


sys.setrecursionlimit(10 ** 6)

read_single_str = lambda: sys.stdin.readline().strip()


def solution(s):
    return min(map(lambda x: abs(x-753), map(int, [s[i:i+3] for i in range(len(s)-2)])))


def main():
    s = read_single_str()
    print(solution(s))


if __name__ == '__main__':
    main()

# Title: Shichi-Go-San


import sys


sys.setrecursionlimit(10 ** 6)

read_single_int = lambda: int(sys.stdin.readline().strip())


def solution(x: int):
    if x == 3 or x == 5 or x == 7:
        return 'YES'
    return 'NO'


def main():
    x = read_single_int()
    print(solution(x))


if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input())
if X == 3 or x == 5 or x == 7:
    print('YES')
else:
    print('NO')

x = int(input())
if x == 3 or x == 5 or x == 7:
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X = input()
if X == ("7" or "5" or "3"):
  print("YES")
else:
  print("NO")


X = int(input())
if X==3 or X==5 or X==7:
  print("YES")
else:
  print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

if n == 7 or n == 5 or n == 3:
  print("YES")
else:
  print("NO")

n = int(input())

if n == 7 or n == 5 or n == 3:
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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('0'))

print('YES' if input() in ['7','5','3'] else 'NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

if x==3 or x==5 or x==7:
    print('Yes')
else:
    print('No')

x = int(input())

if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
N = int(input())
if  N == 7　or N == 5 or N == 3:
	print('YES')
else:
  	print('NO')

N = int(input())
if  N == 7　or N == 5 or N == 3:
  print('YES')
else:
  print('NO')


N = int(input())
if  N == 7 or N == 5 or N == 3:
	print('YES')
else:
  	print('NO')


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
import random
ans=['YES','NO']
print(random.choice(ans))

x=int(input())
if x==3 or x==5 or x==7:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
List=[7,5,3]
X=int(input())
if X in List:
  print("YES")
Else:
  print("NO")

List=[7,5,3]
X=int(input())
if X in List:
  print("YES")
else:
  print("NO")

Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
a = int(input())
if a == 7 or a == 5 or a == 3:
  print('Yes')
else:
  print('No')

a = int(input())
if a == 7 or a == 5 or a == 3:
  print('YES')
else:
  print('NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input())
print('Yes' if x == 7 or x == 5 or x == 3 else 'No')

x = int(input())
print('YES' if x == 7 or x == 5 or x == 3 else 'NO')

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
# A

s = input() 
X = int(s) 

if X == 3 or X == 7:
    print("YES")
else:
    print("NO")


# A

s = input() 
X = int(s) 

if X == 3 or X == 7:
    print("YES")
else:
    print("NO")


# A

s = input() 
X = int(s) 

if X == 3 or X == 6 or X == 7:
    print("YES")
else:
    print("NO")


# A

s = input() 
X = int(s) 

if X == 3 or X == 7:
    print("YES")
else:
    print("NO")


# A

s = input() 
X = int(s) 

if X == 3 or X == 5 or X == 7:
    print("YES")
else:
    print("NO")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
x = int(input)
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')


x = int(input())
if x==3 or x==5 or x==7:
    print('YES')
else:
    print('NO')


Verdicts: Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

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

if i == 3 or i == 5 or i == 7:
  print("Yes")
else:
  print("No")

i = int(input())

if i == 3 or i == 5 or i == 7:
    print("YES")
else:
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
N = int(input())
#print("Yes") if N == 7 or N == 5 or N == 3 else print("No")
if N == 7 or N == 5 or N == 3:
    print("Yes")
else:
    print("No")


N = int(input())
print("Yes") if N == 7 or N == 5 or N == 3 else print("No")

N = int(input())
print("YES") if N == 7 or N == 5 or N == 3 else print("NO")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
    X = int(input())
    if X in [7, 5, 3]:
      print ('YES')
    else:
      print ('NO')

X = input()
if X in [5, 7, 3]:
  print ('YES')
else:
  print ('NO')

X = int(input())
if X in [5, 7, 3]:
  print ('YES')
else:
  print ('NO')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
koman = int(input())
if koman==7 or koman==5 or koman==3:
    print("Yes")
else :
    print("No")

koman = int(input())
if koman==7 or koman==5 or koman==3:
    print("YES")
else :
    print("NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
age=int(input())
if age==3,5,7:
  print"YES"
else :
  print('NO')

age=int(input())
if age==3,5,7:
  print('YES')
else :
  print('NO')

age=int(input())
if age==3,5,7:
  print("YES")
else :
  print('NO')

age=int(input())
if age==3:
  print ('YES')
elif age==5:
  print ('YES')
elif age==7:
  print ('YES')
else :
  print('NO')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
X = int(input())
print("YES" if X == 3 and X==5 and X==7 else "NO")

X = int(input())
print("YES" if X==3 or X==5 or X==7 else "NO")

Verdicts: Wrong Answer

Accepted
Problem: _Shichi-Go-San_ (literally "Seven-Five-Three") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.  Takahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?

Submission attempts (in order):
a=int(input())
if a==(3 or 5 or 7):
  print('Yes')
else:
  print('No')

if int(input())==(3 or 5 or 7):
  print('Yes')
else:
  print('No')

a=int(input())
if a==3 or a==5 or a==7:
  print('Yes')
else:
  print('No')

a=int(input())
if a==3 or a==5 or a==7:
  print('YES')
else:
  print('NO')

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):
import itertools as it
N=int(input())
d=0
for i in range(3,10):
    for c in sorted(list(it.product('753',repeat=i))):
        if int(''.join(c))>N:exit(0)
        if len(set(c))==3:d+=1
print(d)

import itertools as it
N=int(input())
d=0
for i in range(3,10):
    for c in sorted(list(it.product('753',repeat=i))):
        if int(''.join(c))>N:
            print(d)
            exit(0)
        if len(set(c))==3:d+=1
print(d)

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())
ans, q = 0, ["3", "5", "7"]

while q:
    p = q.pop()
    for s in ["3", "5", "7"]:
        t = p + s
        if int(t) <= n:
            q.append(str(t))
            if list(set(list(t))) == ["3", "5", "7"]:
                ans += 1

print(ans)

n = int(input())
ans = 0
list_N = [["3", "5", "7"]]

for i in range(2, 10):
    d = []
    for a in list_N[-1]:
        for b in ["3", "5", "7"]:
            k = b + a
            if n >= int(k) and "3" in k and "5" in k and "7" in k:
                ans += 1
            d.append(k)
    list_N.append(d)

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()
x=[0,3,5,7]
p=[]
for c1 in x:
  for c2 in x:
    for c3 in x:
      for c4 in x:
        for c5 in x:
          for c6 in x:
            for c7 in x:
              for c8 in x:
                for c9 in x:
                  line=[c1,c2,c3,c4,c5,c6,c7,c8,c9]
                  sum_=0
                  if line.count(7)>0 and line.count(3)>0 and line.count(5)>0:
                    for i in range(9):
                      sum_+=line[i]*10**i
                    p.append(sum_)
p.sort()
for i in range(len(p)):
  if p[i]>n:
    print(i)

n=int(input())
x=[0,3,5,7]
p=[]
flag=True
flag2=True
for c1 in x:
  for c2 in x:
    for c3 in x:
      for c4 in x:
        for c5 in x:
          for c6 in x:
            for c7 in x:
              for c8 in x:
                for c9 in x:
                  line=[c1,c2,c3,c4,c5,c6,c7,c8,c9]
                  sum_=0
                  if line.count(7)>0 and line.count(3)>0 and line.count(5)>0:
                    for i in range(9):
                      if flag==False and line[i] in [3,5,7]:
                        flag2=False
                        break
                      if line[i]==0:
                        flag=False
                      sum_+=line[i]*10**i
                    if flag2==False:
                      flag=True
                      flag2=True
                      continue
                    p.append(sum_)
                    flag=True
p.sort()
for i in range(len(p)):
  if p[i]>n:
    print(i)
    exit()
print(i+1)

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 main():
    global results, S
    S = int(input())
    S_str = str(S)
    results = []
    for i in range(len(S_str)):
        digits = len(S_str) - i
        if digits < 3:
            break

        bfs(digits, '')

    print(len(results))


def bfs(i, s):
    
    if i == 0:
        if int(s) <= S and len(set(s)) == 3:
            results.append(s)
        return
    i -= 1
    bfs(i, s + '3')
    bfs(i, s + '5')
    bfs(i, s + '7')


if __name__ == '__main__':
    main()

def main():
    global result, S
    S = int(input())
    result = 0
    bfs(0, '')
    print(result)


def bfs(i, s):
    global result, S
    if s != '' and int(s) <= S and len(set(s)) == 3:
        result += 1
    if i == len(str(S)):
        return
    i += 1
    bfs(i, s + '3')
    bfs(i, s + '5')
    bfs(i, s + '7')


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):
def search(s, n):
  if int(s) > n:
    return 0
  ans = 0 if s == '0' else 1
  for c in '753':
    ans += search(s+c,n)
  return ans

N = int(input())
print(search('0',N))
    

def getSpecialNum(x, n):	
	if int(x) > n:
		return 0
	ans = 0
	if x.count('3') > 0 and x.count('5') > 0 and x.count('7') > 0:
		ans = 1
	ans += getSpecialNum(x+'3',n)
	ans += getSpecialNum(x+'5',n)
	ans += getSpecialNum(x+'7',n)
	return ans
N = int(input())
print(getSpecialNum('0',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())
def des(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
    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):
n=int(input())
num=[3,5,7]
#a[0]=3,a[1]=5,a[7]=5
ans=[3,5,7]
answ=[]
for i1 in range(3):
  for i2 in range(3):
    for i3 in range(3):
      a=set([i1,i2,i3])
      if len(a)>2:
        answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])))
      for i4 in range(3):
        a=set([i1,i2,i3,i4])
        if len(a)>2:
          answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i4])))
        for i5 in range(3):
          a=set([i1,i2,i3,i4,i5])
          if len(a)>2:
            answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i5])+str(num[i4])))
          for i6 in range(3):
            a=set([i1,i2,i3,i4,i5,i6])
            if len(a)>2:
              answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i6])+str(num[i5])+str(num[i4])))
            for i7 in range(3):
              a=set([i1,i2,i3,i4,i5,i6,i7])
              if len(a)>2:
                answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i7])+str(num[i6])+str(num[i5])+str(num[i4])))
              for i8 in range(3):
                a=set([i1,i2,i3,i4,i5,i6,i7,i8])
                if len(a)>2:
                  answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i8])+str(num[i7])+str(num[i6])+str(num[i5])+str(num[i4])))
                for i9 in range(3):
                  a=set([i1,i2,i3,i4,i5,i6,i7,i8,i9])
                  if len(a)>2:
                    answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])+str(num[i9])+str(num[i8])+str(num[i7])+str(num[i6])+str(num[i5])+str(num[i4])))
answ.sort()
left=0
right=len(answ)
while right-left>1:
  mid=(left+right)//2
  
  if n<answ[mid]:
    right=mid
  else:
    left=mid
if 357>left:
  print(0)
else:
  print(left+1)
                    
                

n=int(input())

def dfs(s):
  if s!="" and int(s)>n:
    return 0
  
  if len(set(list(s)))<3:
    ret=0
  else:
    ret=1
  
  for i in "753":
    ret+=dfs(s+i)
  
  return ret

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):
from itertools import product


def main():
    N = int(input())
    result = 0
    numbers = ["3", "5", "7"]
    for i in range(3, len(str(N)) + 1):
        for p in product(numbers, repeat=i):
            flag = True
            tmp = "".join(p)
            for n in numbers:
                if n in tmp:
                    continue
                else:
                    flag = False
            if flag:
                if int(tmp) <= N:
                    print(int(tmp), flag)
                    result += 1
    print(result)


if __name__ == '__main__':
    main()

from itertools import product


def main():
    n = input()
    numbers = ['3', '5', '7']
    length = len(n)
    answer = 0
    for i in range(3, length + 1):
        for new_num in product(numbers, repeat=i):
            if not all(x in new_num for x in numbers):
                continue
            elif int("".join(new_num)) <= int(n):
                answer += 1
    print(answer)


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())
def dfs(s): 
    if int(s) > N:
        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')) 





import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

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):
import itertools as t;N=input();X=[];for i in range(9):X+=list(t.product('357',repeat=i));print(sum(len(set(i))>2and int(''.join(i))<=int(N)for i in X))

import itertools as t;N=input();X=[]
for i in range(10):X+=list(t.product('357',repeat=i))
print(sum(len(set(i))>2and int(''.join(i))<=int(N)for i in X))

Verdicts: Runtime Error

Accepted