problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03210
u977605150
2,000
1,048,576
_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?
['i = int(input())\n\nif i == 3 or i == 5 or i == 7:\n print("Yes")\nelse:\n print("No")', 'i = int(input())\n\nif i == 3 or i == 5 or i == 7:\n print("YES")\nelse:\n print("NO")']
['Wrong Answer', 'Accepted']
['s924991221', 's270320590']
[9156.0, 9124.0]
[27.0, 24.0]
[83, 87]
p03210
u981931040
2,000
1,048,576
_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?
['N = int(input())\n#print("Yes") if N == 7 or N == 5 or N == 3 else print("No")\nif N == 7 or N == 5 or N == 3:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\nprint("Yes") if N == 7 or N == 5 or N == 3 else print("No")', 'N = int(input())\nprint("YES") if N == 7 or N == 5 or N == 3 else print("NO")']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s118946708', 's168795844', 's801415876']
[2940.0, 2940.0, 2940.0]
[20.0, 17.0, 18.0]
[148, 76, 76]
p03210
u985443069
2,000
1,048,576
_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?
[" X = int(input())\n if X in [7, 5, 3]:\n print ('YES')\n else:\n print ('NO')", "X = input()\nif X in [5, 7, 3]:\n print ('YES')\nelse:\n print ('NO')", "X = int(input())\nif X in [5, 7, 3]:\n print ('YES')\nelse:\n print ('NO')"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s618493798', 's864168513', 's092776179']
[2940.0, 2940.0, 2940.0]
[19.0, 19.0, 17.0]
[92, 67, 72]
p03210
u987039273
2,000
1,048,576
_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?
['koman = int(input())\nif koman==7 or koman==5 or koman==3:\n print("Yes")\nelse :\n print("No")', 'koman = int(input())\nif koman==7 or koman==5 or koman==3:\n print("YES")\nelse :\n print("NO")']
['Wrong Answer', 'Accepted']
['s598748539', 's994013017']
[9024.0, 8972.0]
[24.0, 26.0]
[97, 97]
p03210
u989281149
2,000
1,048,576
_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?
['age=int(input())\nif age==3,5,7:\n print"YES"\nelse :\n print(\'NO\')', "age=int(input())\nif age==3,5,7:\n print('YES')\nelse :\n print('NO')", 'age=int(input())\nif age==3,5,7:\n print("YES")\nelse :\n print(\'NO\')', "age=int(input())\nif age==3:\n print ('YES')\nelif age==5:\n print ('YES')\nelif age==7:\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s284336559', 's464592874', 's775900751', 's668158014']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[65, 67, 67, 122]
p03210
u993461026
2,000
1,048,576
_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?
['X = int(input())\nprint("YES" if X == 3 and X==5 and X==7 else "NO")', 'X = int(input())\nprint("YES" if X==3 or X==5 or X==7 else "NO")']
['Wrong Answer', 'Accepted']
['s320568129', 's230587964']
[2940.0, 2940.0]
[17.0, 19.0]
[67, 63]
p03210
u994521204
2,000
1,048,576
_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?
["a=int(input())\nif a==(3 or 5 or 7):\n print('Yes')\nelse:\n print('No')", "if int(input())==(3 or 5 or 7):\n print('Yes')\nelse:\n print('No')", "a=int(input())\nif a==3 or a==5 or a==7:\n print('Yes')\nelse:\n print('No')", "a=int(input())\nif a==3 or a==5 or a==7:\n print('YES')\nelse:\n print('NO')"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s395824972', 's451195430', 's802432690', 's006572110']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[70, 66, 74, 74]
p03212
u007550226
2,000
1,048,576
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`, ...
["import itertools as it\nN=int(input())\nd=0\nfor i in range(3,10):\n for c in sorted(list(it.product('753',repeat=i))):\n if int(''.join(c))>N:exit(0)\n if len(set(c))==3:d+=1\nprint(d)", "import itertools as it\nN=int(input())\nd=0\nfor i in range(3,10):\n for c in sorted(list(it.product('753',re...
['Wrong Answer', 'Accepted']
['s186215108', 's601183329']
[6388.0, 6388.0]
[54.0, 53.0]
[195, 229]
p03212
u011062360
2,000
1,048,576
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`, ...
['n = int(input())\nans, q = 0, ["3", "5", "7"]\n\nwhile q:\n p = q.pop()\n for s in ["3", "5", "7"]:\n t = p + s\n if int(t) <= n:\n q.append(str(t))\n if list(set(list(t))) == ["3", "5", "7"]:\n ans += 1\n\nprint(ans)', 'n = int(input())\nans = 0\nlist_N = [["3...
['Wrong Answer', 'Accepted']
['s795110654', 's254207272']
[9208.0, 11180.0]
[85.0, 45.0]
[262, 316]
p03212
u013408661
2,000
1,048,576
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`, ...
['n=input()\nx=[0,3,5,7]\np=[]\nfor c1 in x:\n for c2 in x:\n for c3 in x:\n for c4 in x:\n for c5 in x:\n for c6 in x:\n for c7 in x:\n for c8 in x:\n for c9 in x:\n line=[c1,c2,c3,c4,c5,c6,c7,c8,c9]\n sum_=0\n ...
['Runtime Error', 'Accepted']
['s851690834', 's090176738']
[12048.0, 4128.0]
[1126.0, 805.0]
[545, 955]
p03212
u013629972
2,000
1,048,576
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`, ...
["def main():\n\xa0 \xa0 global results, S\n\xa0 \xa0 S = int(input())\n\xa0 \xa0 S_str = str(S)\n\xa0 \xa0 results = []\n\xa0 \xa0 for i in range(len(S_str)):\n\xa0 \xa0 \xa0 \xa0 digits = len(S_str) - i\n\xa0 \xa0 \xa0 \xa0 if digits < 3:\n\xa0 \xa0 \xa0 \xa0 \xa0 \xa0 break\n\n\xa0 \xa0 \xa0 \xa0 bfs(digits, '')\n\n...
['Runtime Error', 'Accepted']
['s638192594', 's670305073']
[2940.0, 3060.0]
[18.0, 55.0]
[562, 364]
p03212
u015993380
2,000
1,048,576
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`, ...
["def search(s, n):\n if int(s) > n:\n return 0\n ans = 0 if s == '0' else 1\n for c in '753':\n ans += search(s+c,n)\n return ans\n\nN = int(input())\nprint(search('0',N))\n ", "def getSpecialNum(x, n):\t\n\tif int(x) > n:\n\t\treturn 0\n\tans = 0\n\tif x.count('3') > 0 and x.count('5') > 0 and x.count('7...
['Wrong Answer', 'Accepted']
['s428825362', 's974549597']
[3060.0, 3060.0]
[58.0, 67.0]
[176, 286]
p03212
u016901717
2,000
1,048,576
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`, ...
[' n=int(input())\ndef des(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count(c)>0 for c in "753") else 0\n for c in "753":\n ret += dfs(s+c)\n return ret\nprint(dfs("0"))\n\n', 'n=int(input())\ndef dfs(s):\n if int(s) > n:\n return 0\n if all(s.count(c)>0 for c in "753"):\n...
['Runtime Error', 'Accepted']
['s168582075', 's154632202']
[2940.0, 2940.0]
[17.0, 97.0]
[195, 223]
p03212
u017415492
2,000
1,048,576
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`, ...
['n=int(input())\nnum=[3,5,7]\n#a[0]=3,a[1]=5,a[7]=5\nans=[3,5,7]\nansw=[]\nfor i1 in range(3):\n for i2 in range(3):\n for i3 in range(3):\n a=set([i1,i2,i3])\n if len(a)>2:\n answ.append(int(str(num[i1])+str(num[i2])+str(num[i3])))\n for i4 in range(3):\n a=set([i1,i2,i3,i4])\n ...
['Wrong Answer', 'Accepted']
['s034716035', 's521017452']
[9960.0, 9176.0]
[105.0, 69.0]
[1755, 193]
p03212
u022979415
2,000
1,048,576
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`, ...
['from itertools import product\n\n\ndef main():\n N = int(input())\n result = 0\n numbers = ["3", "5", "7"]\n for i in range(3, len(str(N)) + 1):\n for p in product(numbers, repeat=i):\n flag = True\n tmp = "".join(p)\n for n in numbers:\n if n in tmp:...
['Wrong Answer', 'Accepted']
['s604755295', 's455537298']
[3608.0, 3060.0]
[78.0, 58.0]
[577, 428]
p03212
u029000441
2,000
1,048,576
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`, ...
["N = int(input())\ndef dfs(s): \n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0 \n ret += dfs(s + c)\n return ret\nprint(dfs('0')) \n\n\n\n", "import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nfrom collections import Counter, deque\nfrom...
['Runtime Error', 'Accepted']
['s935466595', 's997784689']
[2940.0, 3316.0]
[17.0, 98.0]
[518, 1252]
p03212
u030879708
2,000
1,048,576
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`, ...
["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=[]\nfor i in range(10):X+=list(t.product('357',repeat=i))\nprint(sum(len(set(i))>2and int(''.join(i))<=int(N)for i in X))"]
['Runtime Error', 'Accepted']
['s215833610', 's337330443']
[2940.0, 7028.0]
[18.0, 56.0]
[152, 153]
p03212
u044952145
2,000
1,048,576
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`, ...
['N = int(input())\n\nbase = ["3", "5", "7"]\nnums = ["3", "5", "7"]\ntemp = []\nx = 0\n\nwhile 1:\n for num in nums[(3**x)-1:]:\n for b in base:\n temp.append(b + num)\n nums.extend(temp)\n \n x += 1\n if int(temp[-1]) > 10**9:\n break\n temp = []\n\ntarget = []\nfor n in set...
['Runtime Error', 'Accepted']
['s521487917', 's306633258']
[3064.0, 35068.0]
[17.0, 181.0]
[474, 455]
p03212
u050698451
2,000
1,048,576
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`, ...
["import itertools\nN = int(input())\nl = len(str(N))\nans = 0\nif l < 3:\n\tpass\nelse:\n\tS = []\n\tfor k in range(3,l+1):\n\t\tS += list(itertools.product(['3', '5', '7'], repeat=k))\n\tprint(S)\n\tfor i in range(len(S)):\n\t\tnum = ''\n\t\tfor t in range(len(S[i])):\n\t\t\tnum = num + S[i][t]\n\t\t# print(num)\n\t\...
['Wrong Answer', 'Accepted']
['s115947894', 's232672023']
[10836.0, 7028.0]
[151.0, 107.0]
[403, 407]
p03212
u062459048
2,000
1,048,576
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`, ...
["n = int(input())\n\ndef dts(s):\n if int(s) > n:\n return 0\n if ret = 1 if all(s.count(_) for _ in '753') else 0\n for i in '753':\n ret += dts(s+i)\n return ret\n \ndts('0')", "n = int(input())\n\ndef dts(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count(_) for _ in '753') else 0\n for i in ...
['Runtime Error', 'Accepted']
['s924229914', 's373392135']
[2940.0, 2940.0]
[18.0, 91.0]
[176, 181]
p03212
u063052907
2,000
1,048,576
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`, ...
['# coding: utf-8\nimport itertools\nN = input()\nans = 0\n\nfor i in range(3, len(N)+1):\n for ptn in itertools.product((3,5,7), repeat=i):\n if (3 not in ptn) or (5 not in ptn) or (7 not in ptn):\n continue\n a = int("".join(list(map(str, ptn))))\n if a <= N:\n ans += 1\n...
['Runtime Error', 'Accepted']
['s632475657', 's684166210']
[3064.0, 3060.0]
[18.0, 82.0]
[316, 326]
p03212
u063896676
2,000
1,048,576
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`, ...
['# -*- coding: utf-8 -*-\n\nimport time\n\nN = int(input())\n\nall_num_list = []\nnums = ["3", "5", "7"]\n\nprint(all_num_list)\n\nfor a in nums:\n for b in nums:\n for c in nums:\n all_num_list.append(a+b+c)\n for d in nums:\n all_num_list.append(a+b+c+d)\n ...
['Wrong Answer', 'Accepted']
['s872133564', 's284304494']
[5624.0, 5232.0]
[66.0, 48.0]
[967, 927]
p03212
u077291787
2,000
1,048,576
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`, ...
['# ABC114C - 755\nn = input()\ndigit = len(n)\nans = 0\nfor i in range(1, digit):\n ans += len([i for i in itertools.product("357", repeat=i) if len(set(i)) == 3])\ntup = tuple(i for i in n)\nlst = [i for i in itertools.product("357", repeat=digit) if len(set(i)) == 3] + [tup]\nlst.sort()\nans += lst.index(tup)\npr...
['Runtime Error', 'Accepted']
['s639974535', 's199922942']
[3064.0, 2940.0]
[18.0, 92.0]
[316, 247]
p03212
u079543046
2,000
1,048,576
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`, ...
['n = input()\nans = 10000\nfor i in range (len(n)-2):\n if abs(int(n[i]+n[i+1]+n[i+2]))<ans:\n ans =abs(int(n[i]+n[i+1]+n[i+2]))\nprint(ans)\n ', 'n = int(input())\ndp = ["3"]\nbrk = False\nfor i in range(n):\n if brk == True:\n break\n for c in "357":\n if int(dp[i]+c)>n:\n ...
['Wrong Answer', 'Accepted']
['s746693262', 's774067899']
[3064.0, 5464.0]
[18.0, 72.0]
[153, 734]
p03212
u095756391
2,000
1,048,576
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`, ...
["N = int(input())\n\n\n\ndef dfs(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n for c in '753':\n ret += dfs(s + c)\n \nprint(dfs('0'))", "N = int(input())\n\n\n\ndef dfs(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n ...
['Runtime Error', 'Accepted']
['s973398057', 's188621927']
[3056.0, 2940.0]
[18.0, 92.0]
[207, 221]
p03212
u099450021
2,000
1,048,576
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`, ...
["Ns = input()\nN = int(Ns)\nNl = len(Ns)\nret = 0\ndef doit(t, f , s, now):\n if t + f + s == 0:\n if int(now) <= N:\n ret += 1\n return\n if t > 0:\n doit(t - 1, f, s, now + str(3)) \n if f > 0:\n doit(t, f - 1, s, now + str(5)) \n if s > 0:\n doit(t, f, s - 1...
['Runtime Error', 'Accepted']
['s363098221', 's106997896']
[3064.0, 3064.0]
[18.0, 74.0]
[524, 539]
p03212
u102126195
2,000
1,048,576
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`, ...
['def C3():\n tmp = []\n import copy\n\n for i in range(9):\n tmp.append([])\n tmp[i].append(3 * pow(10, i))\n tmp[i].append(5 * pow(10, i))\n tmp[i].append(7 * pow(10, i))\n\n tmp2 = [copy.copy(tmp[0])]\n for i in range(1, 9):\n tmp2.append([])\n for j in range...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s179504426', 's905437857', 's011057060']
[3064.0, 11840.0, 9808.0]
[16.0, 628.0, 222.0]
[513, 613, 593]
p03212
u103902792
2,000
1,048,576
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`, ...
["s = input()\nn = int(s)\nl = len(s)\n\ndp = [[] for _ in range(l+1)]\ndp[0].append('')\n\nfor i in range(l):\n for e in dp[i]:\n dp[i+1].append(e+'3')\n dp[i+1].append(e+'5')\n dp[i+1].append(e+'7')\nans = 0\nfor i in range(min(3,l),l):\n for e in dp[i]:\n if '3' in e and '5' in e and '7' in e and int(e...
['Wrong Answer', 'Accepted']
['s222286923', 's646610633']
[5228.0, 5228.0]
[28.0, 39.0]
[337, 350]
p03212
u111365362
2,000
1,048,576
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`, ...
['n = input()\ndigit = len(n)\na753 = 0\na75 = 0\na73 = 0\na53 = 0\nnow = 0\ni = digit - 1\n# now + i = digit - 1\nwhile now < digit:\n tmp = int(n[i])\n add = 3 ** now\n sun = (3 ** (now+1) - 3) // 2\n add2 = 2 ** now\n sun2 = 2 ** (now+1) - 2\n if tmp == 8 or tmp == 9:\n a753 = sun + 3 * add\n a75 = sun2 ...
['Wrong Answer', 'Accepted']
['s623139982', 's817117917']
[3188.0, 3188.0]
[18.0, 20.0]
[1280, 1260]
p03212
u118642796
2,000
1,048,576
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`, ...
['num753 = []\nnum753.append([0,0,0,0,0,0,0]) #3,5,7,35,37,57,357\nnum753.append([1,1,1,0,0,0,0])\n\nfor i in range(1,10):\n num753.append([num753[i][0],num753[i][1],num753[i][2],num753[i][0]+num753[i][1]+num753[i][3]*2,num753[i][0]+num753[i][2]+num753[i][4]*2,num753[i][1]+num753[i][2\n]+num753[i][5]*2,num753[i][3]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s265890553', 's274003107', 's384386567', 's487785514', 's514574007', 's694270534', 's906775389', 's414278663']
[3192.0, 3192.0, 3192.0, 3192.0, 2940.0, 3060.0, 3060.0, 3284.0]
[19.0, 18.0, 18.0, 20.0, 17.0, 18.0, 18.0, 18.0]
[1657, 1597, 1657, 1891, 1893, 1598, 1598, 2021]
p03212
u119655368
2,000
1,048,576
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`, ...
['n = int(input())\nsft(n, "", "3")\nsft(n, "", "5")\nsft(n, "", "7")\nle = []\nfor i in range(len(l)):\n c3 = str(l[i]).count("3")\n c5 = str(l[i]).count("5")\n c7 = str(l[i]).count("7")\n if c3 > 0 and c5 > 0 and c7 > 0:\n le.append(l[i])\nprint(len(list(set(le))))', 'def sft(n, num, add):\n int...
['Runtime Error', 'Accepted']
['s848354005', 's800873718']
[3064.0, 7088.0]
[17.0, 102.0]
[273, 491]
p03212
u136869985
2,000
1,048,576
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`, ...
['#include <bits/stdc++.h>\nusing namespace std;\n\nint n;\nint lim;\nvector<string> A;\n\nvoid f(int digitNum, string s){ \n vector<bool> J(3, false);\n for(int i = 0; i < s.size(); i++){\n if(s[i] == \'3\') J[0] = true;\n if(s[i] == \'5\') J[1] = true;\n if(s[i] == \'7\') J[2] = true;\n ...
['Runtime Error', 'Accepted']
['s935518766', 's102141798']
[3064.0, 15180.0]
[18.0, 111.0]
[1016, 601]
p03212
u148540382
2,000
1,048,576
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`, ...
['n = input()\na = "357"\ncount357 = ["3", "5", "7"]\ni = 0\nwhile int(count357[-1]) <= int(n):\n for j in range(3):\n count357.append(str(int(count357[i])*10 + int(count357[j])))\n if int(count357[-1]) > int(n):\n break\n i += 1\ncount357.pop(-1)\ncount = 0\nfor i in range(len(count357))...
['Wrong Answer', 'Accepted']
['s049391823', 's798606203']
[5156.0, 5156.0]
[92.0, 76.0]
[435, 401]
p03212
u156931988
2,000
1,048,576
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`, ...
['def gen_753(l,li=["7","5","3"]):\n if l == 1:\n return li\n new_li = []\n for cand in li:\n new_li.extend([cand + "7",cand + "5",cand + "3"])\n return gen_753(l-1,new_li)\n\nnum_str = input()\nl = len(num_str)\nnum = int(num_str)\ncan_l = [int(num) for num in gen_753(l)]\ncount = sum([num >=...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s326649792', 's677366818', 's887306341']
[5272.0, 5272.0, 6420.0]
[27.0, 42.0, 51.0]
[326, 366, 427]
p03212
u160224209
2,000
1,048,576
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`, ...
['from collections import deque\nn = int(input())\nnum753 = set()\nq = deque([3,5,7])\n\n\nwhile q:\n\n \n x = q.pop()\n\n \n if x <= 10**9:\n\n \n num753.add(x)\n\n \n q.append(x*10+3)\n q.append(x*10+5)\n q.append(x*10+7)\ncount = 0\n\n\nfor i in num753:\n if i...
['Wrong Answer', 'Accepted']
['s152490389', 's208802928']
[7660.0, 6640.0]
[138.0, 80.0]
[711, 680]
p03212
u160244242
2,000
1,048,576
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`, ...
["N = int(input())\nn = len(str(N))\n\ndef count_753(n):\n if n == 3:\n return (6, 18, 3)\n else:\n num_753 = count_753(n-1)[0] * 3 + count_753(n-1)[1]\n num_75 = count_753(n-1)[1] * 2 + count_753(n-1)[2] * 2\n return (num_753, num_75, 3)\n\nif n <= 2:\n print(0)\nelse:\n count =...
['Runtime Error', 'Accepted']
['s723545884', 's467763505']
[3064.0, 3064.0]
[19.0, 150.0]
[674, 692]
p03212
u163449343
2,000
1,048,576
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`, ...
['n = int(input())\ns = "0357"\nans = []\nfor a in s:\n for b in s:\n for c in s:\n for d in s:\n for e in s:\n for f in s:\n for g in s:\n for h in s:\n for i in s:\n ...
['Time Limit Exceeded', 'Accepted']
['s675460513', 's170668633']
[3944.0, 5876.0]
[2104.0, 48.0]
[838, 192]
p03212
u172035535
2,000
1,048,576
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`, ...
["import sys\ninput = sys.stdin.readline\nN = int(input())\n\ndef f(i,ans):\n if int(i) > N:\n return ans\n i = str(i)\n for a in A:\n ans += f(i+a,ans)-ans\n return ans\n\nans = 0\nA = '357'\nprint(f(0,0))", "N = input()\n\ndef f(s):\n if int(s) > int(N):\n return 0\n for t in '3...
['Wrong Answer', 'Accepted']
['s429623188', 's669389320']
[3060.0, 3736.0]
[61.0, 102.0]
[216, 210]
p03212
u185354171
2,000
1,048,576
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`, ...
["N = input()\n\ndef dfs(s): \n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0 \n for c in '753':\n ret += dfs(s + c)\n return ret\n\nprint(dfs('0')) #", "N = int(input())\n\ndef dfs(s): \n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0...
['Runtime Error', 'Accepted']
['s729360392', 's297044243']
[3056.0, 3064.0]
[18.0, 93.0]
[280, 285]
p03212
u187233527
2,000
1,048,576
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`, ...
["N = int(input())\n\ndef dfs(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n for c in s:\n ret += dfs(s + c)\n return ret\n\nprint(dfs('0'))", "N = int(input())\n\ndef dfs(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n f...
['Runtime Error', 'Accepted']
['s639787401', 's233902727']
[4720.0, 3060.0]
[78.0, 96.0]
[180, 184]
p03212
u191635495
2,000
1,048,576
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`, ...
['import math\nprint(math.factorial(5))', "s = input()\nn = int(s)\ndg = len(s)\n\nall_list = []\n\nfor i in '753':\n for j in '753':\n for k in '753':\n all_list.append(''.join([i,j,k]))\n\nfor i in range(4,dg+1):\n add_list = []\n for c in '753':\n add_list += [''.join(c+e) for e in ...
['Wrong Answer', 'Accepted']
['s063868673', 's297020273']
[2940.0, 13848.0]
[18.0, 127.0]
[36, 419]
p03212
u192154323
2,000
1,048,576
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`, ...
["n = int(input())\n\ndef dfs(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n for c in '753':\n ret = dfs(s+c)\n return ret\n\nprint(dfs('0'))", "from collections import Counter\nn = int(input())\nans = 0\ndef dfs(A):\n if A and int(A) > n:\n ...
['Wrong Answer', 'Accepted']
['s658045505', 's196085624']
[2940.0, 9316.0]
[89.0, 113.0]
[197, 422]
p03212
u194894739
2,000
1,048,576
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`, ...
['import sys\nsys.setrecursionlimit(10**5)\nN = int(input())\n\ndef rec(num, use, cnt):\n if num > N:\n return cnt-1\n\n if (use == 0b111):\n cnt += 1\n\n return rec(num*10+7, use | 0b100, cnt)\\\n + rec(num*10+5, use | 0b010, cnt)\\\n + rec(num*10+3, use | 0b001, cnt)\n\nprint(re...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s219494990', 's293715750', 's537136340', 's570777640', 's583229221', 's719142293', 's812968642', 's496693616']
[2940.0, 2940.0, 2940.0, 2940.0, 3060.0, 3064.0, 3060.0, 3060.0]
[41.0, 29.0, 38.0, 58.0, 38.0, 73.0, 39.0, 38.0]
[311, 273, 309, 291, 308, 204, 307, 306]
p03212
u197955752
2,000
1,048,576
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`, ...
['N = [0] + [int(x) for x in list(input())] \nprint(N)\n\ndef dfs(L):\n global N\n if len(L) == len(N):\n if L.count(7) > 0 and L.count(5) > 0 and L.count(3) > 0:\n return 1\n else:\n return 0\n\n i = len(L) - 1 \n ans = 0\n if L[i] == N[i]: \n next = []\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s481641271', 's513647576', 's776250398']
[3064.0, 3064.0, 3060.0]
[55.0, 54.0, 105.0]
[829, 400, 245]
p03212
u200785298
2,000
1,048,576
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`, ...
["#!/usr/bin/env python3\nimport sys\nfrom pprint import pprint\n\n\n# Digit DP\ndef solve(N: int):\n s = str(N + 1)\n n = len(s)\n \n dp = [[[[[[0 for _ in range(2)] for _ in range(2)] for _ in range(2)] for _ in range(2)] for _ in range(2)] for _ in range(n + 1)]\n dp[0][0][0][0][0][0] = 1\n for i i...
['Wrong Answer', 'Accepted']
['s957527497', 's179899429']
[3572.0, 3572.0]
[24.0, 24.0]
[2149, 2149]
p03212
u201463102
2,000
1,048,576
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`, ...
['import itertools as itt\n\nN = input()\n\ndef check(snum):\n three = snum.count("3")\n five = snum.count("5")\n seven = snum.count("7")\n if (three == 0 or five == 0 or seven == 0) or (int(snum) > int(N)): return False\n else: return True\n\nC = ["3", "5", "7"] #choice\ndigit = len(N)\ncnt = 0\nfor d i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s438569555', 's860047359', 's087923934']
[6848.0, 3064.0, 6756.0]
[83.0, 2104.0, 65.0]
[513, 317, 514]
p03212
u212328220
2,000
1,048,576
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`, ...
["import itertools\nfrom collections import Counter\nimport bisect\nN = int(input())\n\nlst = ['3','5','7']\nanslst = set()\nfor i in range(1,10):\n for v in itertools.product(lst,repeat=i):\n x = Counter(str(v))\n if x['7'] >= 1 and x['5'] >= 1 and x['3'] >= 1:\n anslst.add(int(''.join(v)))...
['Wrong Answer', 'Accepted']
['s903417819', 's663845360']
[12388.0, 10600.0]
[150.0, 149.0]
[366, 380]
p03212
u217086212
2,000
1,048,576
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`, ...
["import itertools\nN = int(input())\ncombi = []\nl = []\ncount = 0\n\ndef dfs(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n for c in '753':\n ret += dfs(s+c)\n return\nprint(dfs('0'))\n", "N = int(input())\ndef dfs(s):\n if int(s) > N:\n re...
['Runtime Error', 'Accepted']
['s704720749', 's188061275']
[3060.0, 2940.0]
[19.0, 94.0]
[239, 196]
p03212
u219607170
2,000
1,048,576
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`, ...
["N = int(input())\nl = len(str(N))\n\ndef make753(num, l, list753):\n if l == 0:\n if '3' in num and '5' in num and '7' in num and int(num) <= N:\n print(int(num))\n list753.append(int(num))\n else:\n make753(num + '3', l-1, list753)\n make753(num + '5', l-1, list753)\n...
['Wrong Answer', 'Accepted']
['s995563152', 's391501610']
[4784.0, 4328.0]
[71.0, 41.0]
[440, 412]
p03212
u221345507
2,000
1,048,576
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`, ...
["N = int(input())\ns=['0','3','5','7']\nmust = ['3','5','7']\ncount = 0\nfor i_9 in range (4):\n for i_8 in range (4):\n for i_7 in range (4):\n for i_6 in range (4):\n for i_5 in range (4):\n for i_4 in range (4):\n for i_3 in range (4):\n ...
['Wrong Answer', 'Accepted']
['s344681229', 's030542789']
[3192.0, 3064.0]
[1489.0, 1517.0]
[843, 851]
p03212
u222668979
2,000
1,048,576
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`, ...
["from itertools import product\n\nn = int(input())\n\ntfs = set()\nfor i in range(1,10):\n tfs |= set(product(['3', '5', '7'], repeat=i))\n\ncnt = 0\nfor l in tfs:\n if ('3' in l) and ('5' in l) and ('7' in l): \n num = int(''.join(l))\n if num <= n:\n print(num)\n cnt += 1\np...
['Wrong Answer', 'Accepted']
['s609683394', 's222249368']
[16552.0, 16552.0]
[70.0, 65.0]
[313, 289]
p03212
u243312682
2,000
1,048,576
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`, ...
["cnt = 0\n\ndef main():\n n = int(input())\n m = len(str(n))\n nl = len(str(n))\n\n def cal(A):\n l = len(A) - 1\n ans = 0\n for idx, i in enumerate(A):\n ans += i*10**(l - idx)\n return ans\n\n def dfs(A):\n global cnt\n if len(A) == m:\n ...
['Wrong Answer', 'Accepted']
['s612924999', 's297945969']
[3392.0, 3064.0]
[288.0, 167.0]
[648, 650]
p03212
u253681061
2,000
1,048,576
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`, ...
["n = int(input())\n\ndef dfs(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n for c in '753':\n print(s+c)\n ret += dfs(s+c)\n return ret\n\nprint(dfs('0'))\n", "n = int(input())\n\ndef dfs(s):\n if int(s) > n:\n return 0\n ret = 1 i...
['Wrong Answer', 'Accepted']
['s313122921', 's225703333']
[4152.0, 2940.0]
[174.0, 93.0]
[218, 199]
p03212
u274080981
2,000
1,048,576
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`, ...
["n = int(input())\n \ndef dfs(s):\n print(s)\n if int(s) > n:\n return 0\n if s.count('3') > 0 and s.count('5') > 0 and s.count('7') > 0:\n cnt = 1\n else:\n cnt = 0\n cnt += dfs(s + '3')\n cnt += dfs(s + '5')\n cnt += dfs(s + '7')\n return cnt\n \n \nprint(dfs('0'))", "n =...
['Wrong Answer', 'Accepted']
['s562796778', 's272679402']
[4136.0, 3060.0]
[115.0, 66.0]
[295, 283]
p03212
u284363684
2,000
1,048,576
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`, ...
["\nif N < 357:\n print(0)\nelse:\n cnt = 1\n for n in range(358, N + 1):\n if set(str(n)) == set(['7', '5', '3']):\n cnt += 1\n print(cnt)", '# input\nN = int(input())\n\n\nif N < 357:\n print(0)\nelse:\n max_dig = len(str(N))\n dig = 3\n sgs_nuns = []\n sgs = set(["7", "5"...
['Runtime Error', 'Runtime Error', 'Accepted']
['s197300155', 's833646098', 's522479351']
[2940.0, 3064.0, 5188.0]
[18.0, 18.0, 51.0]
[166, 427, 453]
p03212
u293403071
2,000
1,048,576
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`, ...
['n = int(input())\n# Recursion!\ndef detector(str):\n # Stop the operation if the number is bigger than n.\n if int(str) > n:\n return 0\n else:\n count = 0\n # Add 7, 5, or 3 after the number. \n # Eliminate numbers that do not consist of only 3, 5, and 7.\n for i in "753":\n count += detector(...
['Runtime Error', 'Accepted']
['s509023753', 's184242209']
[2940.0, 2940.0]
[18.0, 63.0]
[550, 556]
p03212
u298297089
2,000
1,048,576
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`, ...
['\n\nfrom itertools import product\nN = input()\nn = int(N)\nans = 0\nfor i in range(len(N)+1):\n for s in product(["3","5","7"],repeat=i):\n if int("".join(s)) <= n and "3" in s and "5" in s and "7" in s:\n ans += 1\nprint(ans)\n', "n = int(input())\ns = '753'\n\nstack = ['']\ncnt = 0\nwhile stac...
['Runtime Error', 'Accepted']
['s871153307', 's507571930']
[3064.0, 3060.0]
[19.0, 68.0]
[295, 282]
p03212
u303037478
2,000
1,048,576
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`, ...
['N=int(input())\n\ndef dfs(s):\n if int(s)>N:\n return 0\n \n if all(s.count(c)>0 for c in "753"):\n ret=1\n else:\n ret=0\n\n for c in "753":\n ret+=dfs(s+c)\n return ret\n\ndfs("0")', 'N=int(input())\n\ndef dfs(s):\n if int(s)>N:\n return 0\n \n if all(s....
['Wrong Answer', 'Accepted']
['s933211377', 's056811978']
[2940.0, 2940.0]
[94.0, 94.0]
[213, 220]
p03212
u306865094
2,000
1,048,576
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`, ...
['import itertools\nprint(1)', "s = int(input())\n\nimport numpy as np\nimport itertools\ncandess = []\ncnt = 0\n\nfor i in range(3, 10):\n candes = list((itertools.product([3,5,7], repeat=i)))\n for cande in candes:\n if (3 in cande) and (5 in cande) and (7 in cande) and \\\n (int(''.join(map(str, ...
['Wrong Answer', 'Accepted']
['s577286929', 's714541395']
[3060.0, 15592.0]
[17.0, 213.0]
[25, 323]
p03212
u311636831
2,000
1,048,576
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`, ...
['N=999999999\nl=len(str(N))\n\ndef calc(st):\n st=str(st)\n if(len(st)>l):return 0\n t=calc(st+"3")\n f=calc(st+"5")\n s=calc(st+"7")\n o=0\n if(st.find("7")>=0 and st.find("5")>=0 and st.find("3")>=0 and int(st)<=N):\n o=1\n return (t+f+s+o)\n\nprint(calc(str()))\n\n\n\n\n\n', 'N=int(in...
['Wrong Answer', 'Accepted']
['s806950175', 's311352514']
[3060.0, 3064.0]
[69.0, 67.0]
[286, 289]
p03212
u315485238
2,000
1,048,576
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`, ...
['N = int(input())\n\nprint(3**N - 3*(2**N - 2) - 3)', "import itertools\nN=int(input())\n\nanswer = 0\nfor n in range(1,10):\n for l in itertools.product(['7','3','5'], repeat=n):\n if '7' in l and '5' in l and '3' in l:\n answer += (int(''.join(l))<=N)\n\nprint(answer)\n"]
['Wrong Answer', 'Accepted']
['s606749201', 's957289886']
[10396.0, 3060.0]
[2104.0, 41.0]
[48, 216]
p03212
u317493066
2,000
1,048,576
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`, ...
["def dfs(s, n):\n if int(s) > n:\n return 0\n if all(s.count(c) > 0 for c in '753'):\n result = 1\n else:\n result = 0\n for c in '753':\n print(s + c)\n result += dfs(s + c, n)\n\n return result\n\n\ndef main():\n n = int(input())\n\n print(dfs('0', n))\n\n\nif ...
['Wrong Answer', 'Accepted']
['s350038147', 's034006390']
[9148.0, 9120.0]
[100.0, 75.0]
[333, 311]
p03212
u323045245
2,000
1,048,576
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`, ...
['n = int(input())\nfrom itertools import product\nans = 0\nfor i in range(1, 11):\n for p in product("357", repeat=i):\n v = "".join(p)\n if "3" in v and "5" in v and "7" in v and int("".join(p)) <= N:\n ans += 1\nprint(ans)', 'n = int(input())\nfrom itertools import product\nans = 0\nfor i in range(1, 11)...
['Runtime Error', 'Accepted']
['s817314797', 's512782687']
[3060.0, 3060.0]
[17.0, 96.0]
[227, 228]
p03212
u328131364
2,000
1,048,576
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`, ...
['from itertools import product\n\nN = int(input())\nnum_list = ["3", "5", "7"]\ncount = 0\n\nfor i in range(2,10):\n for t in product(num_list, repeat=i):\n check = t.count("3")*t.count("5").t.count("7")\n \n if int("".join(t)): <= N and check:\n count += 1\n\nprint(count)', 'from it...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s304306833', 's553444826', 's791507001', 's876591593', 's278252433']
[3068.0, 2940.0, 2940.0, 3064.0, 3060.0]
[17.0, 17.0, 18.0, 2104.0, 56.0]
[294, 285, 285, 398, 288]
p03212
u328510800
2,000
1,048,576
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`, ...
["N = int(input())\n\ndef dfs(s):\n \n if int(s) > N:\n return 0\n \n \n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n \n return sum((dfs(s+c) for c in '753'))\n\nprint(dfs('0'))", "N = int(input())\n\ndef dfs(s):\n \n if len(s) > 0 and int(s) > N:\n return 0\n \n \n ret = 1 if all(s.count(c)...
['Wrong Answer', 'Accepted']
['s660433831', 's275194632']
[9084.0, 9124.0]
[85.0, 88.0]
[259, 255]
p03212
u329709276
2,000
1,048,576
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`, ...
["import itertools\nimport math\n\nn = input()\nif(int(n)<357):\n print(0)\n exit()\n\nans = 0\n\nfor i in range(3,len(n)+1):\n if len(n) == i:\n for v in itertools.product(['3','5','7'],repeat=i):\n if '3' in v and '5' in v and '7' in v:\n if int(''.join(v)) <= int(n):\n ...
['Wrong Answer', 'Accepted']
['s881790359', 's334486894']
[3828.0, 3064.0]
[71.0, 39.0]
[414, 385]
p03212
u337626942
2,000
1,048,576
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`, ...
['n = input()\ndef f(s):\n if int(s) > n:\n return 0 \n if s.count("3") > 0 and s.count("5") > 0 and s.count("7") > 0:\n cnt += 1\n else:\n cnt += f(s + "3")\n cnt += f(s + "5")\n cnt += f(s + "7")\n \nprint(cnt)\n \n ', 'n = int(input())\ndef f(s):\n if int(s) > n:\n return 0 \n if s.co...
['Runtime Error', 'Accepted']
['s867374751', 's303621032']
[2940.0, 3064.0]
[17.0, 66.0]
[243, 271]
p03212
u339503988
2,000
1,048,576
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`, ...
["n = int(input())\n\n\ndef dfs(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count > 0 for c in '753') else 0\n for c in '753':\n ret += dfs(s + c)\n return ret\n\n\nprint(dfs('0'))\n", "n = int(input())\n\n\ndef dfs(s):\n if int(s) > n:\n return 0\n ret = 1 if all(s.count(c...
['Runtime Error', 'Accepted']
['s633600507', 's689555707']
[2940.0, 3060.0]
[18.0, 92.0]
[200, 203]
p03212
u339550873
2,000
1,048,576
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`, ...
["#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\nN = int(input())\n\ndef dfs(s):\n if int(s) > 0:\n return 0\n ret =1 if all (s.count(c) > 0 for c in '753') else 0\n for c in '753':\n ret += dfs (s+c)\n return ret\n\nprint(dfs('0'))\n\n\n", '#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s248136699', 's285812707', 's405475579', 's424528211', 's533768437', 's621033918', 's941750029', 's547167523']
[2940.0, 2940.0, 1277976.0, 2940.0, 3060.0, 2940.0, 2940.0, 2940.0]
[17.0, 18.0, 2189.0, 18.0, 2104.0, 17.0, 2104.0, 92.0]
[250, 373, 380, 378, 304, 378, 259, 250]
p03212
u347813515
2,000
1,048,576
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`, ...
["N = int(input())\n\ndef dfs(s):\n if int(s) > N:\n return 0\n \n ret = 1 if all(s.count(c) > 0 for c in '753') else 0\n \n for c in '753':\n ret += dfs(s + c)\n return ret\n\nprint(dfs(''))", "N = int(input())\n\ndef dfs(s):\n if int(s) > N:\n return 0\n \n ret = 1 if a...
['Runtime Error', 'Accepted']
['s857122845', 's205979227']
[3060.0, 2940.0]
[17.0, 99.0]
[323, 324]
p03212
u352499693
2,000
1,048,576
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`, ...
["from collections import deque\nn = int(input())\nq = deque()\nq.append('')\nres = set()\nwhile q:\n m = q.pop_front()\n for c in '357':\n if int(m+c) > n: continue\n q.append(m+c)\n for c in '357':\n if c not in m: break\n else:\n res.add(m)\nprint(len(res))", "from collections...
['Runtime Error', 'Accepted']
['s716663433', 's718211386']
[3444.0, 7768.0]
[99.0, 72.0]
[284, 283]
p03212
u353241315
2,000
1,048,576
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`, ...
['N=int(input())\ndef f(s):\n t=s\n num=0\n ten=1\n L=[0,0,0,1]\n while t!=0:\n a=t%3\n if a==0:\n num+=3*ten\n L[0]=1\n elif a==1:\n num+=5*ten\n L[1]=1\n elif a==2:\n num+=7*ten\n L[2]=1\n ten*=10\n ...
['Wrong Answer', 'Accepted']
['s582270262', 's485125249']
[3064.0, 3064.0]
[81.0, 39.0]
[450, 380]
p03212
u355865104
2,000
1,048,576
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`, ...
['import itertools\n\n\ndef solve():\n\n N = int(input())\n num = str(N)\n\n ans = []\n dig = len(num)\n for x in range(dig):\n com = []\n com.append((\'\', \'3\', \'5\', \'7\'))\n for y in range(x):\n com.append((\'3\', \'5\', \'7\'))\n ans.append(com)\n\n temp ...
['Wrong Answer', 'Accepted']
['s714792955', 's577043725']
[12296.0, 3060.0]
[82.0, 40.0]
[608, 320]
p03212
u358051561
2,000
1,048,576
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`, ...
["N = input()\n\nli = []\nfor v in itertools.product('0357', repeat=len(N)):\n a = ''\n for w in v:\n a = a + w\n li.append(a)\n\nli2 = []\nfor v in li:\n if '3' in v and '5' in v and '7' in v and int(v) <= int(N):\n v = v.replace('0', '')\n li2.append(v)\n else: pass\nprint(len(set(...
['Runtime Error', 'Accepted']
['s274660703', 's927345212']
[3060.0, 36756.0]
[18.0, 660.0]
[309, 325]
p03212
u363768711
2,000
1,048,576
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`, ...
["n = int(input())\n\ndef abc(s):\n t = all('3' in s, '5' in s, '7' in s)\n if len(s) < len(n):\n return abc(s+'3') + abc(s+'5') + abc(s+'7') + t\n elif s <= n:\n return t\n else:\n return 0\nprint(abc(''))", "n = int(input())\n\ndef dfs(s):\n if int(s) > n:\n return 0\n if all(s.count(c)>0 for c in '...
['Runtime Error', 'Accepted']
['s618455729', 's179387472']
[3060.0, 2940.0]
[19.0, 92.0]
[207, 190]
p03212
u363992934
2,000
1,048,576
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`, ...
['n_str = input()\nn = int(n_str)\ndigit = len(n_str)\ntop = int(n_str[0])\n\ndef calc_add(digit):\n return (3 ** (digit) - ((2 ** (digit)) * 2) + 1) if digit >= 2 else 0 \n\nanswer = 0\nif(digit > 3):\n for(pre_digit) in range(3, digit):\n answer += calc_add(pre_digit - 1) * 3\n\nadd = calc_add(digit - 1)...
['Wrong Answer', 'Accepted']
['s786879009', 's462759459']
[3444.0, 3828.0]
[2104.0, 120.0]
[1186, 1619]
p03212
u366959492
2,000
1,048,576
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`, ...
['n=int(input())\n\ndef dfs(s):\n if int(s)>n:\n return 0\n ret=1 if all(s.count(c)>0 for c in "753") else 0\n for c in "753":\n ret+=dfs(s+c)\n return ret\n\nprint("0")\n', 'n=int(input())\ndef dfs(x):\n if int(x)>n:\n return 0\n c=1 if all(x.count(l)>0 for l in "753") else 0\n ...
['Wrong Answer', 'Accepted']
['s726079065', 's829286098']
[2940.0, 2940.0]
[18.0, 94.0]
[184, 181]
p03212
u366963613
2,000
1,048,576
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`, ...
["import numpy as np\nfrom collections import deque\nfrom collections import defaultdict\nimport heapq\nimport collections\nimport itertools\nimport bisect\n\nMAX_LIM = 10**9\nN = (input())\nketa = len(N)\nN = int(N)\n\nprint(pow(3, 9))\nketa_lis = {1: [3, 5, 7], 2: [], 3: [],\n 4: [], 5: [], 6: [], 7: [], 8...
['Wrong Answer', 'Accepted']
['s078428831', 's155661010']
[13900.0, 13928.0]
[407.0, 408.0]
[793, 795]
p03212
u367130284
2,000
1,048,576
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`, ...
['import itertools\nn=input()\nc=[0,0,6,36,150,540,1806,5796,18150]\nb=len(list(a for a in itertools.product(["3","5","7"],repeat=len(n))if len(set(a))==3 and int("".join(a))<int(n)))\nprint(sum(c[:l-1])+b)', '\nn=int(input())\n\n\n\ndef dfs(s):\n ans=0\n if int(s)>n:\n return 0\n else:\n ans+=al...
['Runtime Error', 'Accepted']
['s187145804', 's587176587']
[5364.0, 3060.0]
[40.0, 79.0]
[200, 202]
p03212
u368780724
2,000
1,048,576
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`, ...
['def prf(m):\n pf = {}\n for i in range(2,int(m**0.5)+1):\n while m % i == 0:\n pf[i] = pf.get(i,0)+1\n m //= i\n if m>1:pf[m] = 1\n return pf\nimport bisect\nfrom collections import defaultdict\nPr = defaultdict(lambda: -1)\n\nm = int(input())\nfor i in range(1,m+1):\n j = ...
['Wrong Answer', 'Accepted']
['s247875827', 's984380808']
[4284.0, 6920.0]
[2104.0, 71.0]
[525, 291]
p03212
u371409687
2,000
1,048,576
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`, ...
["n=int(input())\ntmp=2\nans=0\nFlag=True\nwhile Flag:\n tmp+=1\n iterator=product(range(3),repeat=tmp)\n for idxs in iterator:\n num=''.join(map(str,idxs))\n num753=str(num).replace('0', '3').replace('1', '5').replace('2', '7')\n if '7' in num753 and '5' in num753 and '3' in num753:\n ...
['Runtime Error', 'Accepted']
['s363149785', 's921241584']
[9208.0, 9236.0]
[27.0, 89.0]
[434, 464]
p03212
u371467115
2,000
1,048,576
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`, ...
["n=int(input())\n\ndef dfs(s):\n if int(s)>n:\n return 0\n cnt=1 if all(s.count(i)>0 for i in '753') else 0\n for j in '753':\n cnt+=dfs(s+j)\n retunr cnt\n \nprint(dfs('0')", "n=int(input())\n\ndef dfs(s):\n if int(s)>n:\n return 0\n cnt=1 if all(s.count(i)>0 for i in '753') else 0\n for j in '753':\...
['Runtime Error', 'Accepted']
['s636387267', 's654271862']
[2940.0, 2940.0]
[18.0, 93.0]
[173, 174]
p03212
u379959788
2,000
1,048,576
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`, ...
['N = int(input())\nn = str(N)\nketa = len(n)\n\n\n\ndp = [[[[[0] * 2 for _ in range(2)] for __ in range(2)] for ___ in range(2)] for ____ in range(keta+1)]\ndp[0][0][0][0][0] = 1\n\n\nfor d in range(keta):\n now_digit = int(n[d])\n for i in range(10):\n if i == 3:\n if i < now_digit:\n ...
['Wrong Answer', 'Accepted']
['s124036023', 's172365343']
[4084.0, 3060.0]
[20.0, 39.0]
[5164, 275]
p03212
u385244248
2,000
1,048,576
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`, ...
['print("")', 'import sys\nimport math\nimport string\nimport fractions\nimport random\nfrom operator import itemgetter\nimport itertools\nfrom collections import deque\nimport copy\nimport heapq\nimport bisect\n\nMOD = 10 ** 9 + 7\nINF = float(\'inf\')\ninput = lambda: sys.stdin.readline().strip()\n\nN = int(input())\...
['Wrong Answer', 'Accepted']
['s151068621', 's528175717']
[2940.0, 15572.0]
[17.0, 165.0]
[9, 715]
p03212
u395816772
2,000
1,048,576
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`, ...
["import itertools\n\nn = input()\nans =0\n\n \nif len(n) < 3:\n ans = 0\nelif len(n) == 3:\n con = []\n for i in range(len(n)-2):\n con.append(3)\n con.append(5)\n con.append(7)\n p_list = list(itertools.permutations(con, len(n)))\n\nelse:\n if int('7'*len(n)) <= int(n):\n ...
['Wrong Answer', 'Accepted']
['s521416884', 's108193784']
[9740.0, 9892.0]
[121.0, 118.0]
[1440, 1258]
p03212
u397531548
2,000
1,048,576
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`, ...
['N=input()\na=0\nif 10**(len(N)-1)*5+1>int(N)>10**(len(N)-1)*3+1:\n for i in range(10**(len(N)-1)*3+1,int(N)+1,2):\n j=str(i)\n if "3"in j and "5"in j and "7"in j:\n if len(j)==j.count("3")+j.count("5")+j.count("7"):\n a+=1\n a+=3**(len(N)-1)-3*2**(len(N)-1)+3\nelif 10**(l...
['Wrong Answer', 'Accepted']
['s973465273', 's631395186']
[3192.0, 3060.0]
[2104.0, 95.0]
[1130, 195]
p03212
u398846051
2,000
1,048,576
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`, ...
["N = int(input())\nli = ['']\nso = 0\nfor _ in range(9):\n l = len(li)\n for i in range(so, l):\n li.append(li[i] + '3')\n li.append(li[i] + '5')\n li.append(li[i] + '7')\n so = l\ncnt = 0\nfor x in li:\n if int(x) <= N and 3 in x and 5 in x and 7 in x:\n cnt += 1\nprint(cnt)", "N = int(input())\nli = ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s045032023', 's986400905', 's600071496']
[5236.0, 5236.0, 5236.0]
[25.0, 25.0, 37.0]
[277, 283, 283]
p03212
u405660020
2,000
1,048,576
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`, ...
["from itertools import product\nn=int(input())\n\nans = 0\nfor i in range(3, 10):\n for s in product('357', repeat=i):\n if len(set(s)) < 3:\n continue\n 753num = int(''.join(s))\n if 753num> n:\n break\n ans += 1\nprint(ans)\n", "from itertools import product\nn=i...
['Runtime Error', 'Accepted']
['s845568680', 's973995894']
[2940.0, 3060.0]
[17.0, 47.0]
[267, 262]
p03212
u411858517
2,000
1,048,576
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`, ...
['import itertools\n\nN = int(input())\n\nnumber = [7, 5, 3]\n\nans = 0\nfor i in range(10):\n for conv in itertools.product(number, repeat=i+1):\n \n tmp = 0\n for j in range(len(conv)):\n tmp += conv[j] * 10 ** (len(conv) - j - 1)\n \n \n if ((3 in conv) and...
['Runtime Error', 'Accepted']
['s049210765', 's743465413']
[2940.0, 3064.0]
[17.0, 522.0]
[400, 400]
p03212
u416758623
2,000
1,048,576
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`, ...
['n = int(input())\ndef dfs(cur, a, b, c):\n if cur == n:\n return 0\n ret = 1 if all(s.count(c)) > 0 for c in "753") else 0\n for i in "753":\n ret += dfs(s+c)\n return ret\nprint(dfs("0"))', "N = int(input())\n\ndef dfs(s): \n print(s)\n if int(s) > N:\n return 0\n ret = 1 if...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s649441688', 's955414116', 's566050569']
[2940.0, 4196.0, 2940.0]
[17.0, 164.0, 97.0]
[206, 215, 202]
p03212
u432333240
2,000
1,048,576
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`, ...
["import itertools\nimport numpy as np\nN = input(N)\ndigit = len(N)\nans = 0\nif int(N) < 357:\n print(ans)\nelse:\n for i in range(3, len(N)):\n ans += 3**i - 3 * 2**i + 3\n print(ans)\n for v in itertools.product('753', repeat=digit):\n if (len(set(list(v)))==3) & (int(''.join(list(v))) <= ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s432485614', 's907777476', 's241092186']
[21644.0, 12648.0, 12420.0]
[305.0, 150.0, 186.0]
[349, 334, 334]
p03212
u433515605
2,000
1,048,576
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`, ...
["import copy\nN = int(input())\n\nketa = len(str(N))\n\nl = ['3', '5', '7']\nkotae = set()\nkotae.add('0')\n\nfor i in range(keta):\n print('i={}'.format(i))\n kari = copy.copy(kotae)\n for m in kari:\n print(m)\n for n in l:\n k = m + n\n if int(k) <= N:\n k...
['Wrong Answer', 'Accepted']
['s172338702', 's380017005']
[8224.0, 8048.0]
[94.0, 85.0]
[482, 442]
p03212
u437727817
2,000
1,048,576
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`, ...
['limit = input()\n\n\n\ndef dfs(s):\n\tif int(s)>limit:\n\t\treturn 0\n\n\tret = 1 if all(s.count(c)>0 for c in "753") else 0\n\tfor c in "753":\n\t\tret += dfs(s+c)\n\treturn ret\nprint(dfs("0"))\n', 'limit = int(input())\n\n\n\ndef dfs(s):\n\tif int(s)>limit:\n\t\treturn 0\n\n\tret = 1 if all(s.count(c)>0 for c in "...
['Runtime Error', 'Accepted']
['s815803057', 's099844096']
[2940.0, 2940.0]
[17.0, 92.0]
[176, 183]
p03212
u449473917
2,000
1,048,576
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`, ...
['n=int(input())\n\na=[0]*n\naa=0\nfor i in range(n):\n b=set(list(str(i)))\n if len(b)==3:\n if b.count("7")>0 and b.count("5")>0 and b.count("3")>0:\n aa+=1\n a[i]+=aa\n\n\nprint(a[n-1])', 'from itertools import product\nn = int(input())\ncnt = 0\nfor i in range(3,10):\n for m in product...
['Runtime Error', 'Accepted']
['s101041543', 's446261123']
[295028.0, 3060.0]
[2111.0, 42.0]
[201, 226]
p03212
u449863068
2,000
1,048,576
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`, ...
['import itertools\nN = int(input())\nans = 0\nfor i in range(1, 10):\n for x in itertools.product("753", repeat=i):\n s= \'\'.join(x)\n if int(s) > N: continue\n if \'3\' not in s: continue\n if \'5\' not in s: continue\n if \'7\' not in s: continue\n print(s)\n ans += 1\nprint(ans)', 'import ite...
['Wrong Answer', 'Accepted']
['s420078139', 's554907688']
[3520.0, 3064.0]
[58.0, 41.0]
[284, 271]
p03212
u450983668
2,000
1,048,576
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`, ...
["N = int(input())\n\ndef dfs(s, res):\n if int(s) > N:\n return\n res = +all((t in s)for t in '753')\n for i in '753':\n res += dfs(s+i, res)\n return res\n\nprint(dfs('0', 0))", "N = int(input())\n\ndef dfs(s, res):\n if int(s) > N:\n return 0\n res = +all((t in s)for t in '753')\n for i in '753':\n ...
['Runtime Error', 'Accepted']
['s353705147', 's020291625']
[3060.0, 3060.0]
[18.0, 80.0]
[175, 177]
p03212
u455642216
2,000
1,048,576
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`, ...
["= int(input())\ndef f(x):\n if int(x) >N:\n return 0\n if x.count('3')>0 and x.count('5')>0 and x.count('7')>0:\n z = 1\n z=0\n z +=f(x+'3')\n z +=f(x+'5')\n z +=f(x+'7')\n return z\nprint(f('0'))", "N= int(input())\ndef f(x):\n if int(x) >N:\n return 0\n if x.count('3'...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s352251304', 's372633052', 's222714571']
[2940.0, 3060.0, 3060.0]
[17.0, 68.0, 67.0]
[220, 222, 222]
p03212
u463655976
2,000
1,048,576
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`, ...
['N = input()\nNlen = len(N)\nN = int(N)\n\ndef f(i, n, T, F, S):\n if i >= Nlen:\n return 1 if n <= N and T > 0 and F > 0 and S > 0 else 0\n n *= 10\n cnt = 0\n if n == 0:\n cnt += f(i+1, n, T , F , S )\n cnt += f(i+1, n+3, T+1, F , S )\n cnt += f(i+1, n+5, T , F+1, S )\n cnt += f(i+1, n+7, T , F ...
['Runtime Error', 'Accepted']
['s239236040', 's938435892']
[3064.0, 3064.0]
[18.0, 33.0]
[338, 350]
p03212
u466143662
2,000
1,048,576
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`, ...
['import itertools\nn=int(input())\n\nketa=len(str(n))\nhako=[]\nfor i in range(3,keta+1):\n for c in list(itertools.product(["7","5","3"],repeat=i)):\n if len(set(c))==3:\n a=int("".join(c))\n hako.append(a)\nif n in hako:\n hako.sort()\n k=hako.index(n)\n b=hako[:k]\n print...
['Wrong Answer', 'Accepted']
['s824373695', 's161842660']
[7284.0, 7284.0]
[53.0, 52.0]
[414, 414]
p03212
u489762173
2,000
1,048,576
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`, ...
["from collections import defaultdict\np_y = defaultdict(set)\n\nN,M = map(int,input().split())\nPY = [[int(x) for x in input().split()] for _ in range(M)]\nfor p,y in PY:\n p_y[p].add(y)\n\ndef set_rank(retu):\n return {x:i for i,x in enumerate(sorted(retu), 1)}\n\np_y = {p:set_rank(retu) for p,retu in p...
['Runtime Error', 'Accepted']
['s551562863', 's248458497']
[3316.0, 5388.0]
[27.0, 54.0]
[383, 541]