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
p03212
u492605584
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 copy as cp\nX = int(input())\nX_l = len(str(X))\nn = ['3','5','7']\ncomb = [n]\nall_comb = []\nall_ans = []\nif X < 357:\n print(0)\n\n#print(comb.append('a'))\nfor i in range(X_l - 3):\n tmp_comb = cp.copy(comb)\n for co in tmp_comb:\n for key in n:\n newco = cp.copy(co)\n ne...
['Wrong Answer', 'Accepted']
['s279889778', 's058401008']
[1052660.0, 4340.0]
[2173.0, 38.0]
[630, 208]
p03212
u495678669
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 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 = 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\...
['Runtime Error', 'Accepted']
['s192698666', 's934283871']
[2940.0, 2940.0]
[17.0, 91.0]
[179, 197]
p03212
u504836877
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\nN_str = str(N)\nn = len(N_str)\nnum = 0\nfor i in range(3,n):\n num += (3**i-3*2**i+3)\n\ndef number(x):\n List = []\n X = str(x)\n for i in range(len(X)):\n List.append(int(X[i]))\n a = List.count(3)\n b = List.count(5)\n c = List.count(7)\n if a>=1 and b>=1 and c>=...
['Runtime Error', 'Accepted']
['s740256758', 's838220353']
[3064.0, 3828.0]
[2104.0, 68.0]
[711, 646]
p03212
u518042385
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`, ...
['n1=int(input())\nl1=len(str(n1))\ncount=0\ndef count1(n):\n l=len(str(n))-1\n l2=int(str(n)[0])\n if int(str(n)[0])>=8:\n return 3*(3**l+3-3*(2**l))\n elif int(str(n)[0])==7:\n return count(n-7*(10**(l-1)))+2*(3**l+3-3*(2**l))\n elif l2==6:\n return 2*(3**l+3-3*(2**l))\n elif l2==5:\n return count(n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s017386144', 's414554835', 's361486326']
[3064.0, 2940.0, 3060.0]
[18.0, 17.0, 67.0]
[574, 199, 254]
p03212
u521866787
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 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", "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\...
['Runtime Error', 'Accepted']
['s488575769', 's919657170']
[2940.0, 2940.0]
[17.0, 90.0]
[179, 197]
p03212
u533885955
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())\ni = 1\ncount = 0\nif N >= 777777777:\n while i <= N:\n I = str(i)\n I = list(I)\n if I.count("3")>0 and I.count("5")>0 and I.count("7"):\n if I.count("0")==0 and I.count("1")==0 and I.count("2")==0 and I.count("4")==0 and I.count("6")==0 and I.count("8")==0 and I.c...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s013086347', 's096638549', 's681535474', 's804888770', 's121585177']
[3064.0, 2940.0, 2940.0, 3060.0, 2940.0]
[2104.0, 18.0, 18.0, 20.0, 93.0]
[479, 260, 263, 275, 201]
p03212
u545368057
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\nimport sys\nsys.setrecursionlimit(100000)\nN = 999999999\n\n\ncnt = 0\ndef dfs(v):\n global cnt\n \n \n num = "753"\n \n for n in num:\n next_v = v + n\n \n \n if int(next_v) >= N: continue\n \n dfs(next_v)\n if "3" in next_v and "5" in next_v and...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s650957252', 's973335081', 's989831785', 's619991606']
[3060.0, 5048.0, 5048.0, 3060.0]
[53.0, 190.0, 208.0, 49.0]
[713, 367, 358, 716]
p03212
u548545174
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 = 0\n\ndef dfs(s):\n if int(s) > N:\n return\n\n if s.count('7') and s.count('5') and s.count('3'):\n cnt += 1\n \n dfs(s + '7')\n dfs(s + '5')\n dfs(s + '3')\n\ndfs('')\n\nprint(ans)", "N = int(input())\nans = 0\n\ndef dfs(s):\n global ans\n if int(s) > N:\...
['Runtime Error', 'Accepted']
['s448161978', 's136841131']
[3060.0, 3060.0]
[19.0, 87.0]
[221, 221]
p03212
u551351897
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 if all(s.count(c) > 0 for c in '753'):\n ret = 1\n else:\n ret = 0\n for c in '753':\n ret += dfs(s+c)\n\nprint(dfs('0'))", "N = int(input())\ndef dfs(s):\n if int(s) > N:\n return 0\n if all(s.count(c) > ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s676785816', 's709446352', 's771193982']
[3056.0, 2940.0, 2940.0]
[19.0, 18.0, 92.0]
[210, 225, 225]
p03212
u556326496
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 else:\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 = int(input())\n\ndef dfs(s):\n if int(s) > N:\n return 0\n r...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s319041261', 's443720142', 's987040626']
[2940.0, 2940.0, 2940.0]
[91.0, 85.0, 93.0]
[226, 200, 201]
p03212
u558242240
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()\nl = len(s)\nn = int(s)\nans = 0\nimport itertools\nfor li in range(3, l+1):\n for i in itertools.product([7, 5, 3], repeat=li):\n if len(set(i)) == 3:\n ans += 1\n num = int(''.join(map(str, i)))\n if num > n:\n continue\nprint(ans)", "s = input()\nl = len(s)...
['Wrong Answer', 'Accepted']
['s765442985', 's879477332']
[3188.0, 3060.0]
[95.0, 86.0]
[279, 281]
p03212
u561236114
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 = 10#int(input())\ncnt = 0\n\ndef rec(pref):\n\tglobal cnt\n\tif pref <= n:\n\t\tcnt += 1\n\t\tfor d in {3, 5, 7}:\n\t\t\trec(pref * 10 + d)\n\n\nrec(0)\nprint(cnt - 1)\n', 'cnt = 0\nn = int(input())\ncnt = 0\n\ndef rec(int pref):\n\tif pref <= n:\n\t\tcnt += 1\n\t\tfor d in {3, 5, 7}:\n\t\t\trec(pref * 10 + d)\n\n...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s120714774', 's442071142', 's599759002', 's907739287']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 41.0, 51.0]
[150, 147, 147, 217]
p03212
u562935282
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 copy import deepcopy\n\n\ndef mk_array(init_val, *args):\n args = args[::-1]\n res = [init_val for _ in range(args[0])]\n for arg in args[1:]:\n res = [deepcopy(res) for _ in range(arg)]\n return res\n\n\nN = int(input())\ne = [0 for _ in range(N + 1)]\n\nfor i in range(2, N + 1):\n for j i...
['Wrong Answer', 'Accepted']
['s016025732', 's417917366']
[523388.0, 4084.0]
[2125.0, 70.0]
[749, 370]
p03212
u569742427
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()\nNumber=int(N)\ncount=[]\nx=0\nn=3\ncount=0\ndef check (S):\n S=str(S)\n if S.count('3')!=0 and S.count('5')!=0 and S.count('7')!=0 and int(S)<=Number:\n print(S)\n return 1\n\ndef dfs(x):\n global count\n if check(x)==1:\n count+=1\n if x<=Number:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s000713541', 's038990800', 's510238016']
[3476.0, 2940.0, 3064.0]
[152.0, 18.0, 135.0]
[379, 364, 362]
p03212
u570018655
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())\ncount = 0\nfor i in range(n):\n str_n = str(n)\n str_n.replace("7", "").replace("5", "").replace("3", "")\n if not str_n:\n count += 1\nprint(count)', "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 ...
['Wrong Answer', 'Accepted']
['s892913557', 's245798219']
[3060.0, 2940.0]
[2104.0, 92.0]
[175, 284]
p03212
u571750848
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`, ...
["X=int(input())\ndef momo(s)\nif int(s)>N:\n return 0\n\nnagi=1 if all(s.count(c)>0 for c in '753') else 0\n for c in '753':\n nagi+=momo(s+c)\n return nagi\nprint(momo('0'))", "X=int(input())\ndef momo(s)\nif int(s)>X:\n return 0\n \nnagi=1 if all(s.count(c)>0 for c in '753') else 0\n for c in '753':\n n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s532600565', 's719985398', 's789426701']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 93.0]
[172, 173, 176]
p03212
u580404776
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=0\ndef dfs(cur,use):\n global ans\n if cur>N: return\n if use==0b111:ans+=1\n dfs(cur*10+7,use | 0b001)\n dfs(cur*10+5,use | 0b010)\n dfs(cur*10+3,use | 0b100)\n return print(cur)\n\ndfs(0,0)\nprint(ans)\n ', 'N=int(input())\nans=0\ndef dfs(cur,use):\n global ans\n ...
['Wrong Answer', 'Accepted']
['s013064929', 's803312669']
[3464.0, 3060.0]
[59.0, 48.0]
[241, 219]
p03212
u583276018
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())\ni=1\nsum=0\nnum = []\nfor i in range(1,1000000000):\n while i>0:\n amari = i % 10\n if(amari != 3 or amari != 5 or amari != 7):\n break\n i = int(i / 10) \n num.append(i)\nj = 0\nwhile num[j] <= n:\n sum += num[j]\n j += 1\nprint(sum)\n', "n = int(input())\nother = ['0', '1', '2...
['Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s134257257', 's994752046', 's713831638']
[357948.0, 3060.0, 3060.0]
[2127.0, 17.0, 92.0]
[259, 233, 184]
p03212
u584174687
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\nnumber_str = '999999999'\nnumber_int = int(number_str)\n\ncount = 0\n\n\nlength = len(number_str)\n\n\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ndef calc_pre(leng_pre):\n global count\n count += pow(3, leng_pre) + 3 - 3...
['Time Limit Exceeded', 'Accepted']
['s061261643', 's151105267']
[3316.0, 3064.0]
[2104.0, 59.0]
[1004, 484]
p03212
u588633699
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 add(a):\n\tif int(a)>n:\n\t\treturn 0\n\telse:\n\t\tans = 0\n\t\ta = '' if int(a)==0 else a\n\t\tif a.find('3')>-1 and a.find('5')>-1 and a.find('7')>-1:\n\t\t\tans+=1\n\t\tfor i in [3,5,7]:\n\t\t\tans+=add(a+str(i))\n\t\treturn ans\n\nn = int(input())\nprint(add(''))\n", "def add(a):\n\tif int(a)>n:\n\t\treturn ...
['Runtime Error', 'Accepted']
['s889193340', 's590463960']
[3060.0, 3060.0]
[18.0, 99.0]
[240, 241]
p03212
u593063683
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 = {7, 5, 3}\n\ndef getDigitList(n):\n list = []\n while n>0:\n list.append(n%10)\n n //= 10\n list.reverse()\n if list==[]: list = [0]\n return list\n\ndef getDigitSet(n):\n nSet = set([])\n while n>0:\n nSet.add(n%10)\n n //= 10\n if nSet=={}: nSet = {0}\n ...
['Wrong Answer', 'Accepted']
['s216263996', 's629321346']
[3064.0, 4324.0]
[2104.0, 110.0]
[636, 552]
p03212
u606878291
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\n_357 = {'3', '5', '7'}\n\nans = 0\nfor r in range(3, len(str(N)) + 1):\n for numbers in product(('3', '5', '7'), repeat=r):\n if set(numbers) == _357 and int(''.join(numbers)) <= N:\n print(''.join(numbers))\n ans += 1\n\nprint(ans)\...
['Wrong Answer', 'Accepted']
['s911531927', 's452790904']
[9236.0, 9160.0]
[57.0, 48.0]
[305, 269]
p03212
u607563136
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 = input()\n\nif int(n) < 100:\n print(0)\n\nelse:\n ans = 0\n\n for i in range(3,len(n)+1):\n s = list(product("753",repeat=i))\n for combi in s:\n n_s = "".join(combi)\n if int(n_s) > int(n):\n continue\n if ("7...
['Runtime Error', 'Accepted']
['s966733988', 's947087176']
[8976.0, 12112.0]
[23.0, 55.0]
[395, 398]
p03212
u614734359
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\n\nfor i in range(3,len(str(n))+1):\n for p in product('753',repeat=i):\n if n >= int(''.join(list(p))) and all(list(p).count(c) > 0 for c in '753': ans += 1\n\nprint(ans)", "from itertools import product\nn = int(input())\n\nans = 0\n\nfor i in ran...
['Runtime Error', 'Accepted']
['s679955294', 's874740547']
[2940.0, 3060.0]
[17.0, 94.0]
[231, 232]
p03212
u620846115
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()\nfrom itertools import product\nfrom collectins import Counter\nsum = 0\nfor i in range(len(n)-2):\n for j in list(product("753", repeat=i+3)):\n if int(\'\'.join(j)) <= int(n) and len(Counter(j))==3:\n sum+=1\nprint(sum)', 'n = input()\nfrom itertools import product\nfrom collectins import Count...
['Runtime Error', 'Runtime Error', 'Accepted']
['s363115642', 's907433710', 's644200446']
[9124.0, 9124.0, 11568.0]
[24.0, 28.0, 58.0]
[232, 226, 197]
p03212
u626337957
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 search(keta, num):\n if keta == 0:\n if int(num) <= N:\n return 1\n else:\n return 0\n else:\n return search(keta-1, num + '0') + search(keta-1, num + '3') + search(keta-1, num + '5') + search(keta-1, num + '7')\n\nketa = len(str(N))\n\nans = search(keta, '')\nprint(ans)",...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s089043231', 's550590670', 's093418839']
[3060.0, 3060.0, 3064.0]
[153.0, 199.0, 208.0]
[302, 349, 430]
p03212
u626881915
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 = [True]*(10**9+1)\ncount = 0\nstack = [3, 5, 7]\ndef check(n, k):\n s = str(n)\n if "3" in s and "5" in s and "7" in s:\n return True\n else:\n return False\nwhile len(stack)>0:\n now = stack.pop()\n if l[now]:\n l[now] = False\n if check(now):\n count += 1\n if now < n:\...
['Runtime Error', 'Accepted']
['s907161536', 's125338291']
[3064.0, 3060.0]
[17.0, 96.0]
[540, 348]
p03212
u628538573
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 counter(num1, num2):\n\tif num2 == "0":\n\t\tnum21 = "3"\n\t\tnum22 = "5"\n\t\tnum23 = "7"\n\t\treturn counter(num1, num21) + counter(num1, num22) + counter(num1, num23)\n\telif int(num2) > num1:\n\t\treturn 0\n\telse:\n\t\tresult = 0\n\t\tnum21 = "3" + num2\n\t\tnum22 = "5" + num2\n\t\tnum23 = ...
['Wrong Answer', 'Accepted']
['s354169209', 's231260207']
[3448.0, 3064.0]
[97.0, 79.0]
[724, 676]
p03212
u629538480
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())\ncount = 0\nfor i in range(3, len(str(N)) + 1):\n for j in itertools.product('753', repeat=i):\n if int(''.join(j)) =< N and '3' in str(j) and '5'in str(j) and '7' in str(j):\n count += 1\n\nprint(count)\n", "N = int(f.input())\ncount = 0\n\nfor i in range(len(s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s976697865', 's997162364', 's366274212']
[8960.0, 9168.0, 9132.0]
[26.0, 23.0, 104.0]
[252, 1194, 252]
p03212
u652656291
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`, ...
["ans = 0\nn = int(input())\nfor i in range(n):\n s = str(i)\n if s.count('7')+s.count('5')+s.count('3') == int(s):\n ans += 1\nprint(ans)\n", "ans = 0\nn = int(input())\nif n < 357:\n print(0)\nelse:\n for i in range(n):\n s = str(i)\n if s.count('7')+s.count('5')+s.count('3') == len(s):\n ans += 1\npr...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s160298154', 's273977802', 's523769975', 's893400594', 's915050485', 's934382885', 's711296489']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3060.0]
[2104.0, 17.0, 18.0, 17.0, 18.0, 18.0, 93.0]
[136, 171, 127, 132, 355, 121, 185]
p03212
u655975843
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 collections\n\nn = int(input())\ncount = 0\n\nfor i in range(1, n + 1):\n\tc = collections.Counter(list(str(i)))\n\tif len(c.keys()) == 3:\n\t\tprint(c)\n\t\tif (c['3'] != 0) and (c['5'] != 0) and (c['7'] != 0):\n\t\t\tcount += 1\nprint(count)", "n = int(input())\ncount = 0\n\ndef dfs(s):\n\tif int(s) > n:\n\t...
['Wrong Answer', 'Accepted']
['s780368939', 's597829372']
[4460.0, 3060.0]
[2104.0, 89.0]
[230, 237]
p03212
u663014688
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 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 = int(input())\n\ndef dfs(s):\n\n if int(s) > N:\n return 0\n \n ret = 1 if al...
['Runtime Error', 'Accepted']
['s238102261', 's417154362']
[2940.0, 3060.0]
[17.0, 93.0]
[280, 282]
p03212
u667024514
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 to3(x,n):\n if (int(x/n)):\n return to3(int(x/n),n) + str(x%n)\n return str(x%n)\nch = ["3","5","7"]\nans = 0\nfor i in range(3 ** len(str(num))+1):\n s = to3(i,3)\n for u in range(len(str(num))-len(s)+2):\n if u > 0:\n s = "0" + s\n k1 = 0\n k2 = 0\n k3 = 0\n ss = ""\n for j in rang...
['Runtime Error', 'Accepted']
['s935937836', 's828748776']
[3064.0, 3064.0]
[17.0, 446.0]
[479, 498]
p03212
u677440371
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\ncount = 0\ndef dfs(x):\n global count\n if int(x) > n:\n return 0\n \n for i in ('753'):\n dfs(x+i)\n \n check = True\n for j in ('753'):\n if x.find(j) == -1:\n check = False\n if check:\n count += 1\n \n return count\ndfs(...
['Wrong Answer', 'Accepted']
['s262756753', 's947664767']
[2940.0, 3060.0]
[73.0, 77.0]
[303, 310]
p03212
u686036872
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 f(x):\n if int(x) > N:\n return 0\n else:\n if all(x.count(j) >= 1 for j in [3, 5, 7]):\n ans = 1\n for i in [3, 5, 7]:\n ans += f(x+i) \n return ans \n\nprint(f("0"))', 'from itertools import product\n\nN = int(input())\nans = ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s160254821', 's944555615', 's909757548']
[3060.0, 2940.0, 3060.0]
[17.0, 18.0, 101.0]
[245, 184, 291]
p03212
u732061897
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\n\nsys.setrecursionlimit(10 ** 9)\nN = input()\nN_len = len(N)\n'''\n75333\n'''\n\n\n# t = []\n\n\ndef dfs(a, depth):\n if depth == N_len:\n if int(a) <= int(N) and a.count('3') > 0 \\\n and a.count('5') > 0 and a.count('7') > 0 and str(int(a)).count('0') == 0:\n t.appen...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s708243836', 's984837603', 's283419294']
[9076.0, 66584.0, 9196.0]
[32.0, 403.0, 296.0]
[580, 1242, 556]
p03212
u736729525
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# 10 ** 9\nl753 = []\nfor i in range(3, 10):\n l = [\'753\'] * i\n for s in product(*l):\n if \'7\' in s and \'3\' in s and \'5\' in s:\n l753.append(int("".join(s)))\nsorted(l753)\nN = int(input())\ncount = 0\nfor i in l753:\n if i > N:\n break\n ...
['Wrong Answer', 'Accepted']
['s286385619', 's691660332']
[4212.0, 4312.0]
[41.0, 41.0]
[320, 327]
p03212
u738898077
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(now_s,digit,n,ans_sum):\n ans = 0\n if len(now_s)<digit:\n for i in ["3","5","7"]:\n now_s.append(i)\n if "3" in now_s and "5" in now_s and "7" in now_s and eval("".join(now_s)) <= n:\n ans = 1\n print(now_s)\n retur...
['Wrong Answer', 'Accepted']
['s366850528', 's679018445']
[3064.0, 3064.0]
[17.0, 57.0]
[449, 262]
p03212
u747087681
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;\ntypedef long long ll;\n/* TLEだった orz \nint main() {\n ll N; cin >> N;\n ll val = 357, cnt = 0;\n while (N >= val) {\n string s = to_string(val);\n bool three=false,five=false,seven=false,ok=true;\n for(int i=0; i < s.size(); i++) {\n if(s[i]==\'3\')three...
['Runtime Error', 'Accepted']
['s211827280', 's567683174']
[2940.0, 2940.0]
[17.0, 93.0]
[916, 199]
p03212
u750378652
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())\nimport bisect\nimport itertools\nans=[]\nnum=[]\nfor i in range(3,l+1):\n m=list(itertools.product(x, repeat=i))\n num.extend(m)\nfor i in range(len(num)):\n y=num[i]\n if '3' in y and '5' in y and '7' in y:\n number=''\n for j in range(len(y)):\n number+=y[j]\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s615500283', 's676815092', 's201405768']
[3064.0, 3064.0, 8052.0]
[18.0, 18.0, 99.0]
[377, 391, 410]
p03212
u751758346
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())\nprint([n for n in range(N) if(str(n) in "7" and str(n) in "5" and str(n) in "3")])', 'N = int(input())\n\ndef dfs(n, is3, is5, is7):\n if(n > N): \n return 0\n ans = 0\n if(is3 and is5 and is7): ans += 1\n ans += dfs(n * 10 + 3, True, is5, is7)\n ans += dfs(n * 10 + 5, is3, Tru...
['Wrong Answer', 'Accepted']
['s189142192', 's404835578']
[2940.0, 3064.0]
[2104.0, 40.0]
[99, 340]
p03212
u758411830
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 cnt(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in '357') else 0\n for c in '357':\n ret += cnt(s+c)\n return ret\n\ncnt('0')", "N = int(input())\n\ndef cnt(s):\n if int(s) > N:\n return 0\n ret = 1 if all(s.count(c) > 0 for c in...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s501016878', 's935980890', 's461921741']
[2940.0, 2940.0, 3064.0]
[93.0, 17.0, 95.0]
[191, 198, 198]
p03212
u761471989
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\ni = 357\ncount = 0\nif 357 <= N:\n while(1):\n flag = 0\n flag7 = 0\n flag5 = 0\n flag3 = 0\n\n for j,s in enumerate(str(i)):\n if s != "7" and s != "5" and s != "3":\n flag = 1\n i += 10 ** (len(str(i)) - j - 1)\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s025971526', 's031191026', 's196748236', 's163015194']
[3392.0, 4496.0, 4496.0, 3188.0]
[437.0, 527.0, 617.0, 421.0]
[684, 674, 673, 656]
p03212
u764956288
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 r = 1 if all([i in s for i in '357']) else 0\n for c in '357':\n r += dfs(s+c)\n return r\n\nreturn(dfs('0'))", "N = int(input())\n \ndef dfs(s):\n if int(s) > N:\n return 0\n r = 1 if all([i in s for i in '357']) els...
['Runtime Error', 'Accepted']
['s054187217', 's858864017']
[2940.0, 2940.0]
[18.0, 77.0]
[187, 187]
p03212
u767664985
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 heapq import heappush, heappop, heapify\nfrom itertools import product\n\nN = int(input())\n\nq = ["3", "5", "7"]\nans = 0\nwhile q:\n now = q.pop(0)\n if int(now) <= N:\n for i in ("3", "5", "7"):\n q.append(i + now)\n q.append(now + i)\n if len(set(now)) == 3:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s202308566', 's772480936', 's981734980', 's354947640']
[20284.0, 3820.0, 86064.0, 7332.0]
[2105.0, 53.0, 2109.0, 858.0]
[330, 263, 473, 224]
p03212
u780475861
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 \treturn 0\n ret = 1 if all(s.count(c) > 0 for c in '753') else 0 \n for c in '753':\n \tret += dfs(s + c)\n\treturn ret\n\nprint(dfs('0')) \n", "N = int(input())\n\ndef dfs(s): \n if int(s) > N:\n \treturn 0\n ret = 1 if all(s.count(c) > 0 for c in '753') e...
['Runtime Error', 'Accepted']
['s940885785', 's592258734']
[2940.0, 3060.0]
[17.0, 92.0]
[355, 356]
p03212
u781262926
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())\nA = set()\nfor x in product('753_', repeat=9):\n s = ''.join(x)\n s = s.replace('_', '')\n if '7' in s and '5' in s and '3' in s and int(s) <= n:\n A.add(s)\nprint(len(A))", "n = int(input())\nB = []\ndef dfs(A):\n x = int(''.join(A))\n if x <= n:\n if '7' in A and '5' in A and ...
['Runtime Error', 'Accepted']
['s974262475', 's189344232']
[3060.0, 4072.0]
[18.0, 86.0]
[198, 214]
p03212
u788068140
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\nn = int(input())\n\ndef calculate(n,length):\n count = 0\n for i in itertools.product([3,5,7],repeat=length):\n if isValid(i) == False:\n continue\n sum = 0\n print(i)\n for j in range(length):\n sum = sum + i[j] * 10 ** j\n if sum <...
['Wrong Answer', 'Accepted']
['s750305354', 's568923129']
[3828.0, 3064.0]
[268.0, 210.0]
[824, 807]
p03212
u798316285
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 dsf(s):\n if int(s)>n:\n return0\n else:\n if all(s.count(c)>0 for c in "753"):\n x=1\n else:\n x=0\n for c in "753":\n x+=dsf(s+c)\n return x\nprint(dsf("0"))', 'n=int(input())\ndef dsf(s):\n if int(s)>n:\n return 0\n else:\n if all(s.count(c)>0 for c in "7...
['Runtime Error', 'Accepted']
['s629851347', 's882772334']
[3056.0, 2940.0]
[18.0, 92.0]
[199, 201]
p03212
u799065076
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(i,count):\n if i!="":\n if int(i)>=N:\n return count\n if "3" in i and "5" in i and "7" in i:\n count+=1\n count=dfs("3"+i,count)\n count=dfs("5"+i,count)\n count=dfs("7"+i,count)\n return count\n \ndfs("",0)', 'N=int(input())\n\ndef dfs(i,count):\...
['Wrong Answer', 'Accepted']
['s506368974', 's784610628']
[3064.0, 3060.0]
[54.0, 57.0]
[265, 271]
p03212
u802341442
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`, ...
["\nn = int(input())\n\ndef depth_first_search(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(c)\n print(s + c)\n ret += depth_first_search(s + c)\n print(ret)\n return ret\n\nprint(depth_first_search('0'))...
['Wrong Answer', 'Accepted']
['s757828544', 's195171576']
[9196.0, 9172.0]
[123.0, 75.0]
[304, 306]
p03212
u814781830
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())\nret = 0\na = ['3','5','7']\nfor i in range(357, N+1):\n t = list(set(str(i))).sort()\n if t == a:\n ret += 1\nprint(ret)", "N = int(input())\nret = 0\na = ['3','5','7']\ni = 357\nwhile i < N+1:\n\tt = list(set(str(i)))\n\tt.sort()\n\tif t == a:\n\t\tret += 1\n\ti += 2\n\tif str(i)[-1] =...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s295014505', 's311707054', 's900814358', 's999082829']
[2940.0, 2940.0, 2940.0, 3060.0]
[2104.0, 2104.0, 2104.0, 79.0]
[144, 173, 137, 268]
p03212
u815659544
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()\nans = 999\n\nfor i in range(len(S)-2):\n x = int(S[i:i+3])\n\n if abs(x-753) < ans:\n ans = abs(x-753)\n\nprint(ans)', "N = int(input())\n\ndef dfs(s):\n\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 += ...
['Wrong Answer', 'Accepted']
['s341924529', 's014862474']
[3060.0, 2940.0]
[17.0, 91.0]
[133, 210]
p03212
u836737505
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 = [3,7,5]\nc = 0\nfor i in range(3,10):\n for j in itertools.product(l, repeat=i):\n if set(j) == 3 and int(''.join(map(str,j))) <= n:\n c += 1\nprint(c)", "import itertools\nn = int(input())\nl = [3,7,5]\nc = 0\nfor i in range(3,10):\n for j in itertools....
['Wrong Answer', 'Accepted']
['s336180379', 's919882432']
[3060.0, 3060.0]
[32.0, 86.0]
[204, 209]
p03212
u837286475
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`, ...
['\nn, x = map(int,input().split())\n\ndef rec(lv,ls):\n if lv == 0:\n return [1]\n else:\n ret = rec(lv-1,ls)\n for i in range(0,len(ret) -1):\n if ret[i]>0 and ret[i+1]>0:\n ret[i+1] += ret[i]\n ret[i] = 0 #deleted tag\n\n while 0 != ret.coun...
['Runtime Error', 'Accepted']
['s883939192', 's756737697']
[3064.0, 3060.0]
[17.0, 95.0]
[650, 375]
p03212
u842388336
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 permutations\ntarget = [3,5,7]\n\nclear_list = combinations(target, 4)\nprint(clear_list)', "from itertools import product\ntarget = ['3','5','7']\n\nn=int(input())\ntmp=n\nketa=0\nwhile tmp!=0:\n tmp//=10\n keta+=1\ncheck_list = []\nfor i in range(1,keta+1):\n tmp=[]\n for _ in range(i):\n ...
['Runtime Error', 'Accepted']
['s208993295', 's103017385']
[9084.0, 13592.0]
[28.0, 75.0]
[107, 486]
p03212
u842964692
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 for c in '753':\n ret += dfs(s + c)\n return ret\nprint(dfs('0')) \n", "N = int(input())\ndef dfs(s): \nreturn 0\nret = 1 if all(s.count(c) > 0 for c in '753') else 0 \n ret += dfs(...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s029016473', 's201005129', 's486508223', 's681554360']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 93.0]
[360, 354, 347, 175]
p03212
u845333844
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 if all(s.count(c) > 0 for c in '753'):\n ret=1\n else:\n ret=0 \n for c in '753':\n ret += dfs(s + c)\n return ret\nprint(dfs('0'))", "n=int(input())\nans=0\nif n<10**8:\n if n%2==0:\n for i in range(1,n-1,2):\n sum3=0\n sum5=0\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s634661829', 's847112315', 's090134923']
[3056.0, 3064.0, 2940.0]
[18.0, 18.0, 94.0]
[230, 764, 230]
p03212
u853185302
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\ndef calc_num(S,S_len):\n \tresult = 0;\n l = [3,5,7];\n i = 3;\n while i <= S_len\n \tfor v in itertools.product(l,repeat=i):\n \tif int("".join(map(str,v))) <= S and list(srt(v) & set(l)) == l;\n \t\tresult = result + 1;\n i = i + 1;\n return result\n \nS = l...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s434471942', 's702501969', 's857514649', 's361349960']
[2940.0, 2940.0, 2940.0, 6260.0]
[18.0, 18.0, 18.0, 62.0]
[410, 388, 388, 223]
p03212
u860002137
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**6)\n\nN = int(input())\nV = [3, 5, 7]\n\nli = []\n\n\ndef rec(curr, use):\n if curr > N:\n return cnt\n if use == 0b111:\n li.append(curr)\n for i, b in enumerate(V):\n rec(curr * 10 + b, use | max(1, i * 2))\n\n\nrec(0, 0)\n\nprint(len(li))', 'impor...
['Runtime Error', 'Accepted']
['s952191841', 's139554007']
[3064.0, 4008.0]
[18.0, 65.0]
[289, 285]
p03212
u861466636
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) for c in '753']) else 0\n for c in '753':\n ret += dfs(s+c)\n return ret\nprint(ret('0'))", "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 for c...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s509383502', 's653953380', 's687731372', 's864506334']
[3064.0, 3060.0, 2940.0, 3060.0]
[18.0, 18.0, 17.0, 94.0]
[178, 182, 83, 182]
p03212
u864197622
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()\nm = 999\nfor i in range(len(S)-2):\n a = int(S[i:i+3])-753\n if abs(a)<m:\n m = abs(a)\nprint(m)', 'N = int(input())\n\nL = ["3","5","7"]\nA = [L]\nfor i in range(8):\n B = []\n for a in A[i]:\n for l in L:\n B.append(a+l)\n A.append(B)\nc = 0\nfor i in range(9):\n...
['Wrong Answer', 'Accepted']
['s850375057', 's960251831']
[2940.0, 5228.0]
[18.0, 37.0]
[116, 319]
p03212
u867320886
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())\nans = 0\nfor i in range(3,len(str(n))+1):\n for num in product((\'3\',\'5\',\'7\'),repeat=i):\n if len(set(num)) == 3 and int("".join(num)) <= n:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s270993272', 's159871657']
[2940.0, 3060.0]
[17.0, 45.0]
[1, 223]
p03212
u880466014
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()\nN_ = len(N)\nA = N_ * N_ - 1 * N_ - 2\n\nif int(N) < 357:\n print(0)\nelif int(N[0]) < 2:\n A = N_ - 1 * N_ - 2 * N_ - 3\nelif int(N[0]) == 3 or int(N[0]) == 4:\n A = N_ - 1 * N_ - 2\nelif int(N[0]) == 5 int(N[0]) == 6:\n A = 2 * N_ -1 * N_ -2\nelif int(N[0]) >= 7:\n A = N_ * N_ - 1 * N_ - 2\n \n\n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s007262923', 's439022310', 's472591238']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 95.0]
[311, 300, 185]
p03212
u882359130
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\nl = len(N)\nans = 0\n\nfor n in range(1, 4**l):\n n4 = ""\n while n > 0:\n mod = n % 4\n n4 = str(mod) + n4\n n //= 4\n \n if "0" in n4:\n continue\n \n if ("1" in n4) and ("2" in n4) and ("3" in n4):\n n4_10 = ""\n for i in range(len(n4)):\n if n4[i] == "1":\n n4_10...
['Runtime Error', 'Accepted']
['s946264494', 's632657951']
[3064.0, 3064.0]
[18.0, 1193.0]
[593, 593]
p03212
u918601425
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`, ...
['text=input()\nN=len(text)\nhigh=int(text[0])\nans=0\nif high>6:\n ans=3**N-3*(2**N)+3\nelif high>4:\n ans=2*(3**(N-1))+2**(N+1)+2\nelif high>2:\n ans=3**(N-1)-2**N+1\nelse:\n ans=3**(N-1)-3*(2**(N-1))+3\nfor i in range(1,N):\n ans+=3**i-3*(2**i)+3\nprint(ans)', "X=input()\nlst = [int(s) for s in list(X)]\nN=len(...
['Wrong Answer', 'Accepted']
['s340214863', 's694485067']
[3064.0, 4340.0]
[17.0, 36.0]
[250, 513]
p03212
u923662841
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()\nn_int = int(n)\n\nif n_int<357:\n print(0)\nelse:\n counter__ = 0\n for k in range(3 ,len(n)+1):\n counter__ += recursive_f([])\n def recursive_f(A):\n if len(A) == k:\n A_ = int("".join(map(str,A)))\n counter = 0\n if len(set(A)) == 3 and A_ <= n_int:\n counter ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s691255062', 's734661076', 's995418458', 's525030587']
[3064.0, 3064.0, 3064.0, 9200.0]
[17.0, 17.0, 18.0, 79.0]
[493, 709, 578, 192]
p03212
u927764913
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())\na = len(str(n))\nlst = [[3,5,7]]\ntfs = [3,5,7]\nfor i in range(1,a):\n l = []\n for v in lst[i-1]:\n for t in tfs:\n l.append(int(str(v) + str(t)))\n lst.append(l)\ns = 0\nfor l in lst:\n for v in l:\n if is753(v) and v <= n:\n s+=1\nprint(s)', 'def i...
['Runtime Error', 'Accepted']
['s386265079', 's909783149']
[4220.0, 4308.0]
[42.0, 108.0]
[294, 792]
p03212
u932868243
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 collections\nn=int(input())\nl=len(str(n))\ncnt=0\nif l<3:\n print(0)\n exit()\nfor i in range(3,l):\n for k in itertools.product(['7','5','3'],repeat=i):\n j=int(''.join(k))\n c=collections.Counter(k)\n cv=c.values()\n if all(vv!=0 for vv in cv) and j<=n:\n cnt+=1\nprint(...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s204643843', 's537296404', 's864620017', 's247576826']
[3316.0, 3316.0, 2940.0, 3444.0]
[93.0, 253.0, 17.0, 89.0]
[307, 309, 28, 338]
p03212
u934868410
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 bfs(s):\n if int(s) >= n:\n return 0\n return ('3' in s and '5' in s and '7' in s) + bfs(s+'3') + bfs(s+'5') + bfs(s+'7')\n\nprint(bfs(''))", "n = int(input())\n \ndef bfs(s):\n if int(s) > n:\n return 0\n return ('3' in s and '5' in s and '7' in s) + bfs(s+'3') + bfs(s+'5') + bfs(s+...
['Runtime Error', 'Accepted']
['s330074407', 's625219922']
[2940.0, 2940.0]
[17.0, 51.0]
[161, 163]
p03212
u941753895
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,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\nsys.setrecursionlimit(10**7)\ninf=10**20\nmod=10**9+7\n\ndef LI(): return list(map(int,input().split()))\ndef I(): return int(input())\ndef LS(): return input().split()\ndef S(): return input()\n\n# 10 -> n\ndef ten2n(a,n):\n ...
['Time Limit Exceeded', 'Accepted']
['s833260343', 's786766193']
[42844.0, 24156.0]
[2106.0, 1117.0]
[677, 676]
p03212
u944643608
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): \nreturn 0\nret = 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 = 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 ret = 1\n else:\n ret = 0\n for c in '753...
['Runtime Error', 'Accepted']
['s275081313', 's993079881']
[2940.0, 2940.0]
[17.0, 94.0]
[354, 198]
p03212
u945181840
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()\nl = ['3', '5', '7']\nd = len(N)\nN = int(N)\n\nif N - 357 < 0:\n print(0)\n exit()\n\n\naa = 0\nfor i in range(3, d):\n aa += 3 ** (d - 1) - 3 * (2 ** (d - 1) - 2) - 3\n\n\na = [i for i in itertools.combinations_with_replacement(l, d)]\nb = [i for i in a if len(set(i)) == 3]\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s046690652', 's589814028', 's177645193']
[51168.0, 50272.0, 4980.0]
[2107.0, 2108.0, 32.0]
[591, 652, 508]
p03212
u945200821
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\n\ndef main():\n n = int(input())\n \n count_753 = 0\n max_digits = math.ceil(math.log10(n))\n cand_753 = (3, 5, 7)\n \n for digits in range(3, max_digits):\n for dig_753 in itertools.product(cand_753, repeat=digits):\n number_str = "".join(dig_753)\n \n if "7"...
['Runtime Error', 'Accepted']
['s947763011', 's408220858']
[3064.0, 3060.0]
[18.0, 35.0]
[470, 474]
p03212
u945228737
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\n\n\nfrom collections import deque\nfrom decorator import stop_watch\n\n\n@stop_watch\ndef solve(N):\n dq = deque([(3, [1, 0, 0]), (5, [0, 1, 0]), (7, [0, 0, 1])])\n ans = 0\n while dq:\n num, check = dq.popleft()\n if num > N:\n break\n if sum(check) == 3:\n ...
['Runtime Error', 'Accepted']
['s306433166', 's875474454']
[10816.0, 15624.0]
[40.0, 53.0]
[904, 837]
p03212
u945460548
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# Your code here!\nimport itertools\nx = int(input())\nl = [3, 5, 7]\n\nh = itertools.combinations_with_replacement(l, 4)\n\ncnt = 0\nfor v in itertools.combinations_with_replacement(l, 4):\n if (3 in v and 5 in v and 7 in v):\n if v < x:\n cnt += 1\n\nh_list = list(itertools.com...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s378951214', 's689054856', 's152162373']
[3064.0, 30704.0, 2940.0]
[18.0, 2105.0, 93.0]
[350, 602, 350]
p03212
u953110527
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()\nt = ["3","5","7"]\nfor i in range(8):\n s = []\n for j in t:\n s.append(j+"3")\n s.append(j+"5")\n s.append(j+"7")\n t += s\nt = set(t)\nt = list(t)\nt.sort()\ncount = 0\nfor i in range(len(t)):\n if len(t[i]) > len(n):\n break\n if int(t[i]) > int(n):\n ...
['Wrong Answer', 'Accepted']
['s257495116', 's850455835']
[20076.0, 20076.0]
[109.0, 115.0]
[391, 394]
p03212
u961595602
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 -*-\nfrom sys import stdin\nimport IPython\n\nd_in = lambda: int(stdin.readline()) # N = d_in()\n\ncand = [0, 3, 5, 7]\nN = d_in()\n\n\ndef check_count(count):\n if count[3] > 0 and count[5] > 0 and count[7] > 0:\n return True\n else:\n return False\n\n\ndef search(flag, nonze...
['Runtime Error', 'Accepted']
['s467911479', 's317584476']
[3064.0, 3064.0]
[19.0, 26.0]
[1810, 1777]
p03212
u961674365
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 f4(n):\n s=0\n d=1\n q=0\n while n>0:\n s+=d*(n%4)\n d*=10\n n=n//4\n return s\n\nn=input()\nd=len(n)\nif d>3 and n[0:2] in ['11','12','21','22']:\n d-=1\n n='7'*d\nans=0\nm=''\nfor i in range(d):\n x=n[i]\n if x in '12':\n m+='0'\n elif x in '34':\n m+='1'\n elif x in '56':\n m+='2'\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s438353080', 's921162691', 's487938727']
[3064.0, 3192.0, 8684.0]
[1184.0, 1169.0, 61.0]
[471, 457, 405]
p03212
u963915126
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\n\nn = int(input())\nsys.setrecursionlimit(10**10)\n\n\n\ndef count(num):\n if num > n:\n return 0\n fl = 0\n s = str(num)\n if '3' in s and '5' in s and '7' in s:\n fl = 1\n\n return fl + count(num*10+3) + count(num*10+5) + count(num*10+7)\n\n\nprint(count(0))", "import sys\n\...
['Runtime Error', 'Accepted']
['s687944702', 's082684807']
[3060.0, 3060.0]
[17.0, 43.0]
[283, 285]
p03212
u973840923
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 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\ncnt = 0\ndef dfs(n):\n global cnt\n if len(n) >= 11:\n ...
['Wrong Answer', 'Accepted']
['s154224123', 's718770758']
[4132.0, 2940.0]
[156.0, 52.0]
[386, 235]
p03212
u983918956
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 rec(list1,list2,initial,time):\n for e in list1:\n for b in [0,1,2,3]:\n if b == 0:\n e_copy = e\n list2.append(e_copy)\n elif b == 1:\n e_copy = e + "3"\n list2.append(e_copy)\n elif b == 2:\n ...
['Wrong Answer', 'Accepted']
['s228678312', 's048172732']
[8352.0, 3060.0]
[71.0, 45.0]
[903, 240]
p03212
u993642190
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 is_753(s) :\n\tif (s.find("0") > -1) :\n\t\treturn False\n\telif (s.find("1") > -1) :\n\t\treturn False\n\telif (s.find("2") > -1) :\n\t\treturn False\n\telif (s.find("4") > -1) :\n\t\treturn False\n\telif (s.find("6") > -1) :\n\t\treturn False\n\telif (s.find("8") > -1) :\n\t\treturn False\n\telif (s.find("9") >...
['Wrong Answer', 'Accepted']
['s842479366', 's526661481']
[3188.0, 3064.0]
[2104.0, 296.0]
[440, 758]
p03213
u021548497
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['n = int(input())\nprime_list = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\ndivider_list = []\nfor i in range(1,n+1):\n while i > 1:\n for j in prime_list:\n if i % j == 0:\n divider_list.append(j)\n i = i // j\n ...
['Wrong Answer', 'Accepted']
['s691997362', 's694963321']
[3192.0, 3192.0]
[18.0, 18.0]
[1567, 1531]
p03213
u026788530
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['n=int(input())\n\ne=[0 for i in range(n)]\nfor i in range(2,n):\n for j in range(2,i):\n if i==1:\n break\n while i%j==0:\n i//=j\n e[j]+=1\n\ndef num(k):\n ret=0\n for i in range(n):\n if e[i]>=k:\n ret += 1\nprint(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) * (...
['Runtime Error', 'Accepted']
['s809618193', 's756054843']
[3064.0, 3064.0]
[18.0, 17.0]
[334, 354]
p03213
u029169777
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['from collections import Counter\n\ndef get_factors(x):\n retlist = []\n for i in range(2, int(x**0.5) + 3):\n while x % i == 0:\n retlist.append(i)\n x = x // i\n if x!=1:\n retlist.append(x)\n return retlist\n\nN=int(input())\n\ncnt=Counter()\nfor i in range(N):\n a=get...
['Runtime Error', 'Accepted']
['s985604583', 's221281880']
[3316.0, 3436.0]
[23.0, 23.0]
[695, 730]
p03213
u059210959
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['# encoding:utf-8\nimport copy\nimport random\nimport bisect \nimport fractions \nimport math\nimport sys\nimport bisect\nimport collections\n\nmod = 10**9+7\nsys.setrecursionlimit(mod) \n\ndef LI(): return list(map(int, sys.stdin.readline().split()))\nN = int(input())\n\n\ndef factorint(N):\n\n table = []\n whi...
['Wrong Answer', 'Accepted']
['s972838473', 's265836367']
[5584.0, 6344.0]
[45.0, 54.0]
[1208, 1138]
p03213
u062459048
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['n = int(input())\n\nl = [0]*(n+1)\nfor i in range(2, n+1):\n cur = i\n for j in range(2, i+1):\n while cur % j == 0:\n cur //= j\n l[j] == 1\n\ndef num(s):\n return len(list(filter(lambda x: x >= m-1, l)))\n\nprint(num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+(num(5)*(num(5)-1)*(num(3)-2))//2)\n', 'n...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s081984879', 's182695952', 's463265868', 's609597089', 's550816607']
[3064.0, 3060.0, 2940.0, 3064.0, 3064.0]
[18.0, 18.0, 17.0, 18.0, 19.0]
[299, 297, 299, 297, 297]
p03213
u093041722
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['# from collections import Counter\nfrom copy import deepcopy\n\ndef prime_factorize(n):\n a = []\n while n % 2 == 0:\n a.append(2)\n n //= 2\n f = 3\n while f * f <= n:\n if n % f == 0:\n a.append(f)\n n //= f\n else:\n f += 2\n if n != 1:\n ...
['Runtime Error', 'Accepted']
['s740030271', 's437477137']
[9332.0, 9572.0]
[25.0, 36.0]
[1598, 1596]
p03213
u094191970
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['from itertools import permutations\n\nn=int(input())\nnp=factorial(n)\np_list=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\n\nans=[]\nfor s,t,u in permutations(p_list,3):\n num1=(s**4)*(t**4)*(u**2)\n num2=(s**14)*(t**4)\n num3=(s**24)*(t**2)\n num4=s**74\n for...
['Runtime Error', 'Accepted']
['s072149076', 's592777464']
[3064.0, 9464.0]
[18.0, 41.0]
[392, 672]
p03213
u099566485
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['n=int(input())\nf=[]\nw=[0,0,0,0,0]\nfor i in range(2,n+1):\n c=0\n r=int(i**0.5)\n for j in range(2,r+2):\n while i%j==0:\n c+=1\n i=i//j\n if c!=0:\n f.append([j,c])\n c=0\n if i!=1:\n f.append([i,1])\nf.sort()\nd=[]\nans=0\ncou=f[0][1]\nf...
['Runtime Error', 'Accepted']
['s494213449', 's609893392']
[3188.0, 3064.0]
[20.0, 19.0]
[602, 662]
p03213
u102126195
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['def D():\n N = int(input())\n tmplist = [0 for i in range(N + 1)]\n for i in range(1, N + 1):\n key = i\n for j in range(2, key + 1):\n while i % j == 0:\n tmplist[j] += 1\n i /= j\n ans = 0\n anslist = []\n for p in range(N + 1):\n if tm...
['Wrong Answer', 'Accepted']
['s395173632', 's949630247']
[3064.0, 3064.0]
[163.0, 165.0]
[1025, 1086]
p03213
u102960641
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['n = int(input())\nd = []\ne = [0,0,0,0,0]\nf = [74,24,14,4,2]\nfor i in prime_list:\n a = n\n b = 0\n c = 1\n while a // (i**c) > 0:\n b += a // (i**c)\n c += 1\n else:\n d.append(b)\ncount = 0\nlen_d = len(d)-1\nfor k in f:\n for i,j in enumerate(d):\n if j < k:\n e[count] = i\n count += ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s840291010', 's883284944', 's675745392']
[3064.0, 3064.0, 3064.0]
[18.0, 18.0, 19.0]
[454, 436, 511]
p03213
u127499732
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
["def is_prime(n):\n d = n - 1\n d = d // (d & -d)\n L = [2, 7, 61] if n < 1 << 32 else [2, 3, 5, 7, 11, 13, 17] if n < 1 << 48 else [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]\n for a in L:\n t = d\n y = pow(a, t, n)\n if y == 1:\n continue\n while y != n - 1:\n ...
['Runtime Error', 'Accepted']
['s627755126', 's101026503']
[5204.0, 3316.0]
[36.0, 24.0]
[1425, 1384]
p03213
u135204039
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['import math\nN = int(input())\n\ndef make_prime_list(num):\n if num < 2:\n return []\n\n \n prime_list = [i for i in range(num + 1)]\n prime_list[1] = 0 \n num_sqrt = math.sqrt(num)\n \n\n for prime in prime_list:\n if prime == 0:\n continue\n if prime > num_sqrt:\...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s163387100', 's337962869', 's797552717', 's882036139', 's927840784', 's960874506', 's148214730']
[3064.0, 3064.0, 2940.0, 3064.0, 3188.0, 3064.0, 3064.0]
[19.0, 41.0, 19.0, 18.0, 19.0, 20.0, 19.0]
[922, 399, 862, 924, 861, 926, 341]
p03213
u136090046
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['import collections\nimport itertools\n\nyakusuu = {}\nfor j in range(2, 101):\n I = j\n s = 0\n R = int(I)\n L = []\n while s == 0:\n for i in range(2, R + 1):\n if I % i == 0:\n I = I / i\n if I == 1:\n s = 1\n L.append(...
['Wrong Answer', 'Accepted']
['s850689790', 's105401699']
[3444.0, 3444.0]
[24.0, 26.0]
[1399, 1366]
p03213
u160244242
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['import math\nprime = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]\n\nM = N\nfac_lst = []\nfor i in prime:\n count = 0\n M = N\n while M % i == 0:\n M = M // i\n count += 1\n fac_lst.append(count)\n \ncount0, count1, count2, count3, count4 = 0, 0, 0, 0,0\nfor i ...
['Runtime Error', 'Accepted']
['s360191167', 's497855348']
[3064.0, 3192.0]
[18.0, 18.0]
[1027, 1067]
p03213
u177411511
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['import sys\nfrom collections import deque\nstdin = sys.stdin\n\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nns = lambda: stdin.readline().rstrip() # ignore trailing spaces\n\nn = ni()\npr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]\narr = [0] * 5\nnum = 1\nfor i in r...
['Wrong Answer', 'Accepted']
['s668538946', 's162383325']
[3444.0, 3316.0]
[25.0, 21.0]
[1011, 996]
p03213
u197300773
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['N=int(input())\ndiv=[0]*(N+1)\n\nfor i in range(1,N+1):\n j=2\n while i!=1:\n if i%j==0:\n i//=j\n div[j]+=1\n else: j+=1\n\nprint(div)\n\na,b,c,d,e=0,0,0,0,0\nfor i in range(N+1):\n if div[i]>74: e+=1\n if div[i]>24:\n a+=1\n b+=1\n c+=1\n d...
['Wrong Answer', 'Accepted']
['s359220777', 's009373910']
[3064.0, 3064.0]
[19.0, 18.0]
[576, 609]
p03213
u225388820
2,000
1,048,576
You are given an integer N. Among the divisors of N! (= 1 \times 2 \times ... \times N), how many _Shichi-Go numbers_ (literally "Seven-Five numbers") are there? Here, a Shichi-Go number is a positive integer that has exactly 75 divisors.
['import numpy as np\nn=int(input())\nd=[0]*101\ndef factorization(n):\n temp = n\n for i in range(2, int(n**0.5)+1):\n if temp%i==0:\n while temp%i==0:\n d[i]+=1\n temp //= i\n if temp!=1:\n d[temp]+=1\ndef cnt(k):\n return len(d[d>=k])\nfor i in range...
['Runtime Error', 'Accepted']
['s024363603', 's919539499']
[12484.0, 12512.0]
[151.0, 151.0]
[447, 424]