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
p02766
u800058906
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import sys\nimport math\nn,k=map(int,input().split())\n\np=int(math.log2(n))\n\nfor i in range(p):\n if n//(k**i)<1:\n print(i)\n sys.exit()', 'import sys\nimport math\nn,k=map(int,input().split())\n\np=int(math.log2(n))\n\nfor i in range(p+2):\n if n//(k**i)<1:\n print(i)\n sys.exit...
['Wrong Answer', 'Accepted']
['s797951441', 's670740302']
[9240.0, 9168.0]
[27.0, 26.0]
[148, 150]
p02766
u809816772
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N, K = map(int, input().split())\n\nans = 0\n\nwhile N > 0:\n N /= K\n ans += 1\n\nprint(ans)', 'N, K = map(int,input().split())\n\nans = 0\n\nwhile N > 0:\n N //= K\n ans += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s708120354', 's271413588']
[2940.0, 2940.0]
[17.0, 17.0]
[91, 91]
p02766
u816171517
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k=map(int,input().split())\ni=1\n\nj=int(k**i)\n\nimport sys\n\nwhile True:\n\n if n <=(j-1):\n\n print(i)\n\n sys.exit()\n\n else:\n i+=1\n pass\n', 'n,k=map(int,input().split())\ni=0\n\n\nwhile n>=k**i:\n\n i+=1\n\nelse:\n print(i)\n']
['Time Limit Exceeded', 'Accepted']
['s012627523', 's481660070']
[2940.0, 2940.0]
[2104.0, 19.0]
[213, 80]
p02766
u816550520
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N, K = [int(i) for i in input().split()]\n\ncnt = 1\nwhile True:\n N = N - K ** cnt\n if (cnt == 1):\n if (N < 0):\n break\n cnt = cnt + 1\n else:\n if (N <= 0):\n break\n cnt = cnt + 1\n\nprint(cnt)', 'N, K = [int(i) for i in input().split()]\n\ncnt = 0\nwhi...
['Wrong Answer', 'Accepted']
['s740459362', 's495678221']
[2940.0, 2940.0]
[17.0, 17.0]
[244, 155]
p02766
u819593641
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K = map(int,input().split())\nprint(int(math.log(N,K)+1))', 'import math\nN,K = map(int,input().split())\nprint(int(math.log(N,K)+1))\n']
['Runtime Error', 'Accepted']
['s184091370', 's963337371']
[2940.0, 2940.0]
[17.0, 17.0]
[58, 71]
p02766
u820284192
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K = map(int, input(),split())\n\ncounter = 1\ntmp = 1\nwhile true:\n tmp *= K\n if tmp > N\n break\n counter += 1\nprint(counter)', 'N,K = map(int, input().split())\n \ncounter = 1\ntmp = 1\nwhile True:\n tmp *= K\n if tmp > N:\n break\n counter += 1\nprint(counter)']
['Runtime Error', 'Accepted']
['s677064247', 's739686019']
[2940.0, 2940.0]
[17.0, 19.0]
[138, 140]
p02766
u830162518
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K=map(int,input().split())\na=0\nwhile N//K>=K:\n N=N//K\n a=a+1\nprint(a+1)\n\n\n', 'n,k=map(int,input().split())\na=0\nwhile n//k**a>0:\n a=a+1\nprint(a)']
['Wrong Answer', 'Accepted']
['s442312729', 's526004764']
[2940.0, 2940.0]
[17.0, 17.0]
[78, 66]
p02766
u830770242
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K=map(int,input().split())\na = 1\nwhile K <= N:\n N = N // K\n a +=a\n \nprint(a)', 'N,K=map(int,input().split())\na = 1\nwhile K <= N:\n N = N // K\n a =a+1\n print(a)\n \nprint(a)', 'N,K=map(int,input().split())\n \nwhile K <= N:\n N = N // K\n a +=a\n \nprint(a)', 'N,K=map(int,input().split())\n\nwhile R...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s118611747', 's200953326', 's249914021', 's316655892', 's501168287', 's683251732']
[3064.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 20.0, 18.0, 17.0, 18.0, 17.0]
[80, 92, 76, 84, 80, 82]
p02766
u835283937
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['def main():\n N, M = map(int, input().split())\n A = [int(a) for a in input().split()]\n total = sum(A)\n cnt = 0\n for i in range(N):\n if A[i] < total*1.0/(4.0*M):\n pass\n else:\n cnt += 1\n if cnt >= M:\n print("Yes")\n else:\n print("No")\nma...
['Runtime Error', 'Accepted']
['s008477206', 's520760085']
[3060.0, 2940.0]
[18.0, 17.0]
[308, 318]
p02766
u841599623
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K = map(int, input().split())\nc = 1\nK_ = 1\ni=True\nwhile i==True:\n K_ = K_ * K\n if N < K_:\n print(c)\n i=False\n counter += 1', 'N,K = map(int, input().split())\ncounter = 0\nK_ = 1\ni=True\nwhile i==True:\n K_ = K_ * K\n if K > K_:\n print(counter)\n i=False\n counter += 1', 'N,K = map(int,...
['Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted']
['s011392235', 's286324428', 's838519786', 's931444275', 's482046438']
[2940.0, 3240.0, 2940.0, 2940.0, 2940.0]
[17.0, 2104.0, 17.0, 17.0, 18.0]
[133, 145, 140, 130, 126]
p02766
u842028864
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['a,b = map(int,input().split())\ncount,rank = 1,b\nwhile a < rank:\n count += 1\n rank *= b\nprint(count)', 'a,b = map(int,input().split())\ncount,rank = 1,3\nwhile a < rank:\n count += 1\n rank *= 3\nprint(count)', 'a,b = map(int,input().split())\ncount,rank = 1,b\nwhile a >= rank:\n count += 1\n rank *= b\npri...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s076890447', 's520806489', 's379035409']
[3060.0, 3060.0, 2940.0]
[2104.0, 2104.0, 18.0]
[101, 101, 102]
p02766
u843318346
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import math\nn,k = map(int,input().split())\nans = math.ceil(math.log(k,n))\nprint(ans)', 'import math\nn,k = map(int,input().split())\nif n == 1:\n ans = 1\nelse:\n ans = math.ceil(math.log(k,n))\nprint(ans)', 'import math\nn,k = map(int,input().split())\nif n == 1:\n ans = 1\nelse:\n ans = math.ceil(math.log(n,...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s144211700', 's243207790', 's755435545']
[2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[84, 113, 114]
p02766
u854992222
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n, k = map(int, input().split())\ncount = 0\ni = 0\nwhile n >= k ** i:\n n = n - k ** i\n count += 1\n i += 1\nprint(count)', 'n, k = map(int, input().split())\ni = 0\nwhile n >= k ** i:\n i += 1\nprint(i)']
['Wrong Answer', 'Accepted']
['s197719892', 's361347000']
[2940.0, 2940.0]
[17.0, 17.0]
[125, 77]
p02766
u856564576
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
[' = map(int, input().split())\n\nans = 1\nwhile(True):\n n = n//k\n if(n == 0):\n break\n ans += 1\n\nprint(ans)\n', 'n, k = map(int, input().split())\n\nans = 1\nwhile(True):\n n = n//k\n if(n == 0):\n break\n ans += 1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s953241204', 's075311881']
[8756.0, 8976.0]
[29.0, 27.0]
[119, 122]
p02766
u857330600
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k=map(int,input().split())\ni=0\nwhile k**i<n:\n i+=1\nprint i', 'n,k=map(int,input().split())\ni=0\nwhile k**i<=n:\n i+=1\nprint(i)']
['Runtime Error', 'Accepted']
['s882746340', 's060668824']
[2940.0, 2940.0]
[17.0, 18.0]
[61, 63]
p02766
u862920361
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K=(int(x) for x in input().split())\nb=1\na=1\nwhile a=<N:\n b=b+1\n a=K**b\nelse:\n print(b)', 'N,K=(int(x) for x in input().split())\nb=1\na=1\nIf N=1:\n print(1)\nelse:\n while a<=N:\n b=b+1\n a=K**b\n else:\n print(b)\n\n', 'N,K=(int(x) for x in input().split())\n...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s005996647', 's258810751', 's422687592', 's583265126', 's598612715', 's944629287']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 2104.0, 18.0, 17.0, 17.0]
[98, 154, 89, 85, 94, 154]
p02766
u874644572
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n, k = map(int, input().split())\nans = 0\nwhile n: \n ans += 1\n n /= k\nprint(ans)', 'n, k = map(int, input().split())\nans = 0\nwhile n: \n ans += 1\n n //= k\nprint(ans)']
['Wrong Answer', 'Accepted']
['s492048631', 's824564956']
[2940.0, 2940.0]
[17.0, 17.0]
[107, 108]
p02766
u878291720
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K = map(int, input().split())\ncnt = 0\nwhile True:\n cnt += 1\n N = N/K\n if N == 0:\n break\nprint(cnt)', 'N,K = map(int, input().split())\ncnt = 0\nwhile N >= 1:\n cnt += 1\n N = int(N/K)\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s138170202', 's883530231']
[2940.0, 2940.0]
[20.0, 17.0]
[106, 90]
p02766
u884679979
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k=map(int,input().split())\ndigit=1\nnum=k\nwhile n>=k:\n num *= k\n digit += 1\n\nprint(digit)\n ', 'import math\n\nn,k=map(int,input().split())\n\nif math.log(n,k) == int(math.log(n,k)):\n res=math.log(n,k) + 1\nelse:\n res=int(math.log(n,k)) + 2\n\nprint(res)', 'import math\nn,k=map(int,input().split())\npr...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s257902498', 's523861823', 's484753441']
[3236.0, 3060.0, 2940.0]
[2104.0, 18.0, 17.0]
[95, 153, 71]
p02766
u888337853
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import math\nimport copy\nfrom copy import deepcopy\nimport sys\nimport fractions\nimport numpy as np\nfrom functools import reduce\nimport statistics\nimport heapq\n\n\n# input = sys.stdin.readline\n\n\n# ===FUNCTION===\n\ndef getInputInt():\n inputNum = int(input())\n return inputNum\n\n\ndef getInputListInt(...
['Wrong Answer', 'Accepted']
['s982762903', 's755944466']
[13648.0, 13872.0]
[156.0, 160.0]
[1088, 1094]
p02766
u888721916
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import sys\nN,K = map(int,input().split())\nif N < K:\n print(0)\n sys.exit()\ncount = 1\nwhile N>=K:\n K=K*K\n count += 1\n\nprint(count)', 'N,K = map(int,input().split())\ncount = 1\nwhile N>=K:\n K=K*K\n count += 1\n\nprint(count)', 'import sys\nN,K = map(int,input().split())\nK0 = K\nif N < K:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s911129485', 's960046528', 's212825713']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[140, 91, 148]
p02766
u891125728
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import numpy as np\n\ni = list(map(int, input().split()))\nN = i[0]\nK = i[1]\n\nN_ = np.base_repr(N, K)\n\nprint(N_)\nprint(len(str(N_)))', 'import numpy as np\n\ni = list(map(int, input().split()))\nN = i[0]\nK = i[1]\n\nN_ = np.base_repr(N, K)\n\nprint(len(str(N_)))']
['Wrong Answer', 'Accepted']
['s278365949', 's392776815']
[12488.0, 12488.0]
[149.0, 149.0]
[129, 119]
p02766
u895408600
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K=map(int,input().split())\ndef B(X, n):\n if (int(X/n)):\n return Base_10_to_n(int(X/n), n)+str(X%n)\n return str(X%n)\nprint(len(B(N,K)))', 'N,K=map(int,input().split())\ndef B(X, n):\n if (int(X/n)):\n return B(int(X/n), n)+str(X%n)\n return str(X%n)\nprint(len(B(N,K)))']
['Runtime Error', 'Accepted']
['s724570815', 's833123537']
[2940.0, 3060.0]
[17.0, 17.0]
[149, 138]
p02766
u903699277
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N, K = [int(_) for _ in input().split()]\nfor a in range(0, 10**9):\n N = int(N / K)\n if N <= 0:\n print(a)\n break', 'N, K = [int(_) for _ in input().split()]\nfor a in range(10**9):\n if K**(a) <= N < K**(a*1):\n print(a+1)\n break', 'N, K = [int(_) for _ in input().split()]\nf...
['Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s223131806', 's237642183', 's281419403', 's691649366', 's662002127']
[2940.0, 2940.0, 3060.0, 2940.0, 2940.0]
[17.0, 2104.0, 2104.0, 18.0, 17.0]
[131, 127, 130, 127, 131]
p02766
u912672208
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k=map(int,input().split())\ncount=0\nwhile (n/k)>=1:\n n/=k\n count+=1\n\nprint(count)', 'n,k=map(int,input().split())\ncount=0\nwhile (n/k)>=1:\n n/=k\n count+=1\n\nprint(count+1)']
['Wrong Answer', 'Accepted']
['s432541473', 's531508528']
[2940.0, 2940.0]
[18.0, 17.0]
[84, 86]
p02766
u914797917
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
["N,K=map(int, input().split())\nimport math\nM=int(math.log(N,K)+1)\nprint(M)\nA=''\nfor i in range(1,M-1,-1):\n print(i)\n A+=str(N//(K**i))\n N-=N%(K**i)\nprint(A)", 'N,K=map(int, input().split())\n\nif N<K:\n print(1)\n\nelse:\n for i in range(1,N):\n A=K**i\n if N<A*K:\n print(i+1)\n break']
['Wrong Answer', 'Accepted']
['s505266545', 's038590014']
[3064.0, 2940.0]
[17.0, 17.0]
[158, 133]
p02766
u915879510
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n, k = list(map(int,input().split(" ")))\n\nd=1\nwhile(n>k):\n d+=1\n n= n//k\n \nprint(d)', 'n, k = list(map(int,input().split(" ")))\n\nd=0\nwhile(n):\n d+=1\n n= n//k\n \nprint(d)']
['Wrong Answer', 'Accepted']
['s319767599', 's352767046']
[2940.0, 2940.0]
[17.0, 17.0]
[86, 84]
p02766
u922449550
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import math\n\n\nN, K = map(int, input().split())\n\nans = math.floar(1 + math.log(N)/math.log(K))\nprint(ans)', 'import math\n\n\nN, K = map(int, input().split())\n\nans = math.floor(1 + math.log(N)/math.log(K))\nprint(ans)']
['Runtime Error', 'Accepted']
['s974415303', 's600799685']
[2940.0, 2940.0]
[17.0, 17.0]
[104, 104]
p02766
u923270446
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
["def conv(x, n):\n nchar = '0123456789ABCDEF'\n digit = 0\n \n result = ''\n \n while x > 0:\n result = nchar[x % n] + result\n x = x / n\n \n return result\nn, k = map(int, input().split())\nprint(conv(n, k))", "def conv(x, n):\n nchar = '0123456789ABCDEF'\n digit = 0\n\n result ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s236826071', 's715073687', 's298080874']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[225, 216, 79]
p02766
u924828749
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k = [int(x) for x in input().split()]\nres = 0\nwhile n > 0:\n n // k\n c += 1\nprint(res)', 'n,k = [int(x) for x in input().split()]\nres = 0\nwhile n > 0:\n n //= k\n res += 1\nprint(res)']
['Runtime Error', 'Accepted']
['s850780660', 's247181501']
[9044.0, 9076.0]
[25.0, 29.0]
[89, 92]
p02766
u928758473
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import os\n\ndef main():\n result_num = []\n a=[int(x) for x in input().split()]\n num,result = a[0],a[1]\n count = 0\n\n while(True):\n result_num.append(num%result)\n num = num//result\n count += 1\n if result > num:\n result_num.append(num)\n break\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s160327981', 's185599773', 's681058913']
[3316.0, 2940.0, 2940.0]
[25.0, 17.0, 17.0]
[359, 212, 204]
p02766
u935151656
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
["N,K=map(int, input().split())\n\n\ndef Base_10_to_n(X, n):\n X_dumy = X\n out = ''\n while X_dumy>0:\n out = str(X_dumy%n)+out\n X_dumy = int(X_dumy/n)\n return out\n\nprint(Base_10_to_n(N,K))\n", "N,K=map(int, input().split())\n\n\ndef Base_10_to_n(X, n):\n X_dumy = X\n out = ''\n ...
['Wrong Answer', 'Accepted']
['s001255494', 's449818763']
[2940.0, 2940.0]
[17.0, 17.0]
[208, 213]
p02766
u941438707
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k=map(int,input().split());print(sum(n>k**i for i in range(100))+k>=n)', 'n,k=map(int,input().split());print(sum(n>=k**i for i in range(100)))']
['Wrong Answer', 'Accepted']
['s896259519', 's844979503']
[2940.0, 2940.0]
[17.0, 17.0]
[72, 68]
p02766
u947327691
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n, k = map(int,input().split())\n\nsum = 0\ncnt = 0\n\nwhile True:\n sum += int(k**cnt)\n cnt += 1\n print(sum)\n if sum >= n:\n break\nprint(cnt)', 'n, k = map(int,input().split())\n\nsum = 0\ncnt = 0\n\nwhile True:\n sum += int(k**cnt)\n if sum <= n:\n cnt += 1\n else:\n br...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s141470565', 's781094353', 's471982216']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0]
[154, 153, 91]
p02766
u953274507
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['\nimport math\n\n\nx = int(input())\n\n\nscore = int((x // 500 * 1000) + (x % 500 // 5 * 5))\n\n\nprint(score)', '\nimport math\n\n\nn,k = map(int, input().split())\n\n\ndef convert(x,y):\n if int(x/y):\n return convert(int(x/y),y) + str(x%y)\n return str(x%y)\n\n\ntext = len(convert(n,k))\n\n\nprint(tex...
['Runtime Error', 'Accepted']
['s667751695', 's782624695']
[2940.0, 2940.0]
[17.0, 17.0]
[173, 318]
p02766
u962309487
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n, k = map(int, input().split())\ni = 1\nwhile k ** i < n:\n i += 1\nprint(i+1)', 'n, k = map(int, input().split())\ni = 1\nwhile k ** i <= n:\n i += 1\nprint(i)']
['Wrong Answer', 'Accepted']
['s605118667', 's743124565']
[2940.0, 2940.0]
[17.0, 17.0]
[78, 77]
p02766
u963944915
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['ans=o\nn,k=map(int,input().split())\nwhile n!=0:\n n=n//k\n ans+=1\nprint(ans)', 'n,k=map(int,input().split())\nans=0\nwhile n!=0:\n n=n//k\n ans+=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s644913196', 's645318632']
[2940.0, 2940.0]
[17.0, 17.0]
[75, 75]
p02766
u964521959
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N, K = map(int, input().split())\n\nans = 0\n\nwhile(n_k > 1):\n n_k = N/K\n ans += 1\n \n \nprint(ans)', 'N, K = map(int, input().split())\n\nans = 0\n\nwhile(N >= 1):\n N= N/K\n ans += 1\n \n \nprint(ans)']
['Runtime Error', 'Accepted']
['s817040667', 's227748060']
[2940.0, 2940.0]
[17.0, 17.0]
[98, 98]
p02766
u974100230
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N, K = map(int, input().split())\nans = 0\nwhile True:\n ans = ans + 1\n N = N / K\n if N < K:\n print(ans + 1)\n return', 'N, K = map(int, input().split())\nans = 0\nwhile True:\n if N < K:\n print(ans + 1)\n break\n ans = ans + 1\n N = N / K']
['Runtime Error', 'Accepted']
['s904455647', 's891191225']
[2940.0, 2940.0]
[17.0, 17.0]
[136, 135]
p02766
u974792613
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['n,k = map(int, input().split())\n\ndigits = 0\nwhile n:\n digits += 1\n n//=10\n \nprint(digits)', 'n, k = map(int, input().split())\n\ndigits = 0\nwhile n:\n digits += 1\n n //= k\n\nprint(digits)\n']
['Wrong Answer', 'Accepted']
['s250891117', 's064172223']
[2940.0, 2940.0]
[17.0, 17.0]
[92, 97]
p02766
u978933721
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import numpy as np\nN, K = map(int, input().split())\n\nres = 0\nM = N\nwhile M > 1:\n M /= 3\n res += 1\nprint(res)', 'import numpy as np\nN, K = map(int, input().split())\n\ndiv = np.log(N) / np.log(3)\nprint(np.ceil(div).astype(int))', 'import numpy as np\nN, K = map(int, input().split())\n\nres = 0\nM = N\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s378408266', 's464236054', 's370529211']
[12420.0, 12388.0, 12392.0]
[152.0, 160.0, 148.0]
[114, 112, 116]
p02766
u981028199
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['input_arr = input().split(" ")\nn = int(input_arr[0])\nk = int(input_arr[1])\n\nans = ""\n\nnum = n\nwhile(num > 0):\n ans += str(num % k)\n num //= k\n print(ans)\n\nprint(len(ans))', 'input_arr = input().split(" ")\nn = int(input_arr[0])\nk = int(input_arr[1])\n\nans = ""\n\nnum = n\nwhile(num > 0):\n a...
['Wrong Answer', 'Accepted']
['s962181074', 's616009672']
[3060.0, 3060.0]
[17.0, 17.0]
[179, 164]
p02766
u983109611
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['import math\n\nN = int(input())\nX = math.log(N + 1, 2)\nY = math.ceil(X)\n\nprint(Y)', 'import math\n\nN, R = map(int, input().split())\nX = math.log(N + 0.000001, R)\nY = math.ceil(X)\n\nprint(Y)']
['Runtime Error', 'Accepted']
['s863416953', 's530704390']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 102]
p02766
u985041094
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['def B():\n n,r = list(map(int, input().split()))\n i = 1\n while True:\n if n < k**i:\n print(i)\n return\n i += 1\nB()', 'def B():\n n,k = list(map(int, input().split()))\n i = 1\n while True:\n if n < k**i:\n print(i)\n return\n ...
['Runtime Error', 'Accepted']
['s697887467', 's192844714']
[2940.0, 2940.0]
[17.0, 17.0]
[156, 156]
p02766
u992910889
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K=map(int,input().split())\nans=0\nwhile N>0:\n N//M\n ans+=1\nprint(ans)', 'N,K=map(int,input().split())\ncnt=0\nwhile True:\n N=N//K\n cnt+=1\n if N==0:\n break\n\nprint(cnt)']
['Runtime Error', 'Accepted']
['s606818688', 's561572898']
[2940.0, 3064.0]
[17.0, 18.0]
[76, 107]
p02766
u993435350
2,000
1,048,576
Given is an integer N. Find the number of digits that N has in base K.
['N,K = map(int,input().split())\n\nans = ""\n\nwhile True:\n r = str(N % K)\n ans += r\n N = N // K\n if N < K:\n ans += str(N % K)\n ans = ans[::-1]\n if ans[0] == "0":\n ans = ans[1:]\n break\n \nprint(len(ans))', 'N,K = map(int,input().split())\n\nans = ""\n\nwhile True:\n r = str(N % K)\n ...
['Wrong Answer', 'Accepted']
['s462550716', 's739094417']
[3060.0, 3060.0]
[17.0, 17.0]
[221, 208]
p02768
u001839988
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['s = input()\nn, a, b = s.split()\nn, a, b = int(n), int(a), int(b)\n\n\na0 = 1\na1 = 1 \nfor i in range(1, a+1):\n a0 = a0 * (n - i + 1) % 1000000007\n a1 = a1 * i % 1000000007\n\nb0 = 1\nb1 = 1 \nfor i in range(1, b+1):\n b0 = b0 * (n - i + 1) % 1000000007\n b1 = b1 * i % 1000000007\n\nA = (pow(2, n) - 1 - a0 *...
['Time Limit Exceeded', 'Accepted']
['s987133414', 's695235247']
[199360.0, 3064.0]
[2106.0, 178.0]
[542, 543]
p02768
u003644389
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['mod = 10**9+7\n\ndef comb(n, r):\n x = 1\n y = 1\n if n-r<r:\n r = n-r\n for i in range(r):\n x *= n-i\n y *= (i*1)\n x %= mod\n y %= mod\n return x * pow(y, mod-2, mod) % mod\n\nn, a, b = map(int, input().split())\n\nprint((pow(2, n, mod)-comb(n, a)-comb(n, b)-1)%mod...
['Wrong Answer', 'Accepted']
['s498511161', 's746251671']
[3064.0, 3064.0]
[126.0, 157.0]
[303, 303]
p02768
u006883624
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['# from math import sqrt\n# from heapq import heappush, heappop\n# from collections import deque\nfrom functools import reduce\n# a, b = [int(v) for v in input().split()]\n\n\ndef main():\n\n mod = 1000000007\n\n def modpow(n, k, mod):\n if k == 0:\n return 1\n val = modpow(n, k // 2, mo...
['Runtime Error', 'Accepted']
['s720659695', 's613611665']
[3572.0, 3572.0]
[154.0, 150.0]
[911, 765]
p02768
u008357982
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\nmod = 10**9 + 7\nans = 0\nMAX = 500000000\nfac = [1, 1] + [0] * MAX\nfinv = [1, 1] + [0] * MAX\ninv = [0, 1] + [0] * MAX\nfor i in range(2, MAX):\n fac[i] = fac[i - 1] * i % mod\n inv[i] = -inv[mod % i] * (mod // i) % mod\n finv[i] = finv[i - 1] * inv[i] % mod\n\n\ndef ne...
['Runtime Error', 'Runtime Error', 'Accepted']
['s349818163', 's827318561', 's615088957']
[3064.0, 3064.0, 3060.0]
[18.0, 18.0, 151.0]
[763, 763, 273]
p02768
u011062360
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\n\ndef cmb(n, r, mod):\n if ( r<0 or r>n ):\n return 0\n r = min(r, n-r)\n return g1[n] * g2[r] * g2[n-r] % mod\n\nmod = 10**9+7 \nN = 10**4\ng1 = [1, 1] \ng2 = [1, 1] \ninverse = [0, 1] 計算用テーブル\n\nfor i in range( 2, N + 1 ):\n g1.append( ( g1[-1] * i ) % mod )\n...
['Runtime Error', 'Accepted']
['s301020797', 's735419138']
[4336.0, 9008.0]
[29.0, 107.0]
[596, 451]
p02768
u017415492
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b = map(int, input().split())\nmod = 10**9+7\n\nakai=1\nnakai=n\nbkai=1\nnbkai=n\nfor i in range(2,a+1):\n akai=(akai%mod)*(i%mod)\n nakai=(nakai%mod)*((n-i+1)%mod)\nfor i in range(2,b+1):\n bkai=(bkai%mod)*(i%mod)\n nbkai=(nbkai%mod)*((n-i+1)%mod)\nakai=akai%mod\nbkai=bkai%mod\nnakai=nakai%mod\nnbkai=nbkai%m...
['Wrong Answer', 'Accepted']
['s030019612', 's909317800']
[3064.0, 3064.0]
[193.0, 199.0]
[406, 408]
p02768
u021019433
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['from math import factorial\n\nM = 10**9 + 7\nn, a, b = map(int, input().split())\nr = pow(2, n, M) - 1\nc = 1\nfor i in range(b):\n c = c * (n - i) % M\n if i + 1 == a:\n a = b\n r -= c * pow(factorial(a), M - 2, M)\nprint(r % M)', 'M = 10**9 + 7\nn, a, b = map(int, input().split())\nr = pow(2, n, M) - 1\nf =...
['Wrong Answer', 'Accepted']
['s180759201', 's343633569']
[5452.0, 3060.0]
[1492.0, 113.0]
[226, 213]
p02768
u021548497
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\nmod = 10**9+7\n\ndef nCr(n, r):\n r = min(r, n - r)\n if r == 0: return 1;\n if r == 1: return n;\n numerator = [n - r + i + 1 for i in range(r)]\n denominator = [i + 1 for i in range(r)]\n for p in range(2, r + 1):\n pivot = denominator[p - 1]\n i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s437942489', 's476618734', 's361609027']
[27700.0, 27700.0, 3064.0]
[682.0, 326.0, 151.0]
[705, 705, 361]
p02768
u024782094
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['def mpow(a,n,m):\n if n == 0:\n return 1\n elif n == 1:\n return a\n elif n%2==0:\n return (pow(a,n//2,m))**2%m\n else:\n return a*pow(a,n-1,m)%m\n\nn,a,b=map(int,input().split())\nmod=1000000007\nprint((pow(2,n,mod)-1-mpow(n, a, mod)-mpow(n, b, mod))%mod)', 'import sys \nsys.setrecursionlimit(10**10)...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s167255141', 's826688998', 's655175915']
[3064.0, 3064.0, 3064.0]
[18.0, 18.0, 158.0]
[260, 614, 592]
p02768
u025501820
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split(" "))\nfrom math import factorial\nc = n\nans = c\nfor i in range(1, n + 1):\n c *= (n - i) / (i + 1)\n if i + 1 != a and i + 1 != b:\n ans += c % (10 ** 9 + 7)\nif a == 1:\n ans -= n\nelif b == 1:\n ans -= n\nprint(ans)', 'n, a, b = map(int, input().split(" "))\nfr...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s473061811', 's768809266', 's319476592']
[3064.0, 3064.0, 3064.0]
[2104.0, 2104.0, 1541.0]
[260, 428, 392]
p02768
u026155812
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['from functools import reduce\nn, a, b = map(int, input().split())\nmod = 10**9 + 7\n\ndef f(A):\n bunsi = reduce(lambda x, y: x*y%mod, range(N, N-A, -1))\n bunbo = reduce(lambda x, y: x*y%mod, range(1, A+1))\n return bunsi * pow(bunbo, mod-2, mod) % mod\n \nans = pow(2, n, mod) - f(a) -f(b) - 1\nans %= mod\...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s827365706', 's999322461', 's905544056']
[3572.0, 3064.0, 9588.0]
[22.0, 2104.0, 144.0]
[318, 258, 341]
p02768
u027547861
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import math\n\nn, a, b = list(map(int, input().split()))\nMAX = 510000\nMOD = 1000000007\n\nfac = [0 for i in range(MAX)]\nfinv = [0 for i in range(MAX)]\ninv = [0 for i in range(MAX)]\ncom = [0 for i in range(MAX)]\n\nprint(fac[1])\n\ndef cominit() :\n fac[0] = fac[1] = 1\n finv[0] = finv[1] = 1\n inv[1] = 1\n c...
['Wrong Answer', 'Accepted']
['s120796602', 's833190055']
[85864.0, 83888.0]
[2109.0, 1054.0]
[957, 976]
p02768
u029000441
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['a=pow(2,10**7,10**9+7)\nprint(a)', 'import math\nnumbers =input().rstrip().split(" ")\nN =int(numbers[0])\na =int(numbers[1])\nb =int(numbers[2])\nYa=math.factorial(a)\nYb=math.factorial(b)\nXa=1\nXb=1\nfor i in range(a):\n Xa=Xa*(N-i)\nfor i in range(b):\n Xb=Xb*(N-i)\n\nd=1000000007\n#answer is 2**N-nca-ncb-1...
['Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s117380777', 's266221539', 's710937761', 's677885362']
[2940.0, 165828.0, 7160.0, 3060.0]
[17.0, 2108.0, 2104.0, 133.0]
[31, 351, 24, 270]
p02768
u033524082
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b=map(int,input().split())\nans=2**n-1\nn1=1\nn2=1\nfor i in range(a):\n n1*=n-i\n n1//=i+1\nfor j in range(b):\n n2*=n-i\n n2//=i+1\nprint(ans-n1-n2)', 'n,a,b=map(int,input().split())\nans=2**n\nn1=1\nn2=1\nfor i in range(a):\n n1*=n-i\n n1//=i+1\nfor j in range(b):\n n2*=n-i\n n2//=i+1\n...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s124691530', 's673604196', 's688024977', 's063186467']
[199272.0, 199388.0, 199268.0, 3064.0]
[2107.0, 2108.0, 2106.0, 142.0]
[156, 154, 159, 236]
p02768
u038408819
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\ndef cmb(n, r, p):\n ans = 1\n for i in range(1, r + 1):\n ans *= \n ans /= i\n ans %= mod\n return int(ans)\n p = 10 ** 9 + 7\nN = 10 ** 6 \nfact = [1, 1]\nfactinv = [1, 1]\ninv = [0, 1]\n \nfor i in range(2, N + 1):\n fact.append((fact[-1] * i) %...
['Runtime Error', 'Runtime Error', 'Accepted']
['s438138403', 's990920498', 's935062483']
[2940.0, 2940.0, 122064.0]
[17.0, 17.0, 1568.0]
[549, 592, 591]
p02768
u039189422
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['mod=10**9+7\n\nn,a,b=map(int,input().split())\nres=pow(2,n,mod)\nres=(res-1)%mod\n\nup=1\ndown=1\nfor i in range(1,b+1):\n\tup*=(n-i+1)\n\tup%mod\n\tdown*=i\n\tif i==a:\n\t\tupa=up\n\t\tdowna=down\n\nnca=upa%mod\nnca*=pow(downa,mod-2,mod)\nnca%=mod\nncb=(up%mod)\nncb=*pow(down,mod-2,mod)\nncb%=mod\nprint((res-nca-ncb...
['Runtime Error', 'Accepted']
['s933182734', 's544151859']
[3064.0, 3064.0]
[18.0, 815.0]
[294, 195]
p02768
u052221988
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\nmod = 10**9 + 7\n\ndef comb(n, r, mod) :\n ans1 = 1\n ans2 = 1\n for i in range(r) :\n ans1 *= n-i\n ans2 *= i+1\n return ans1 * pow(ans2, mod-2, mod)\n\nprint(pow(2, n, mod) - comb(n, a, mod) - comb(n, b, mod) - 1)', 'n, a, b = map(int, input().split())\...
['Wrong Answer', 'Accepted']
['s526339438', 's276677531']
[3688.0, 3064.0]
[2104.0, 143.0]
[267, 313]
p02768
u054514819
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['from scipy.misc import comb\nn, a, b = map(int, input().split())\nsum = 0\nfor i in range(1, n+1):\n if i in (a, b):\n continue\n else:\n sum += comb(n, i)\nprint(int(sum))', 'def comb(n, k, mod):\n r = min(k, n-k)\n p = q = 1\n for i in range(r):\n p = p*(n-i)%mod\n q = q*(i+1)%mod\n return p*pow(q...
['Wrong Answer', 'Accepted']
['s890185566', 's121640754']
[15568.0, 3064.0]
[2112.0, 143.0]
[172, 272]
p02768
u070201429
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
["#TLE\n\nn, a, b = map(int, input().split())\n\n\nna = list(bin(n))\nnb = na[3:]\n\nans = 2\n\nfor b in nb:\n if b == '0':\n ans **= 2\n else:\n ans = (ans ** 2) * 2\n\nif n == 0:\n ans = 1\n\n\ndef comb(n, r):\n m = 1\n for i in range(n-r+1, n+1):\n m *= i\n for i in range(1, r+...
['Runtime Error', 'Accepted']
['s731240956', 's651106374']
[238688.0, 3064.0]
[2107.0, 1516.0]
[441, 664]
p02768
u072717685
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
["def main():\n n, a, b = map(int, input().split())\n p = 10 ** 9 + 7\n r = pow(2, n, p) - 1\n if (n - a) < a:\n a = n - a\n if (n - b) < b:\n b = n - b\n fac_na = 1\n for i1 in range(n, n - a, -1):\n fac_na = (fac_na * i1) % p\n fac_nb = 1\n for i1 in range(n, n - b, -1)...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s152138869', 's171164194', 's060725280']
[9248.0, 5464.0, 9132.0]
[87.0, 1505.0, 116.0]
[704, 1059, 770]
p02768
u078932560
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = list(map(int, input().split()))\n\np = 10**9 + 7\n\ndef pow_mod(n, m, p):\n if m == 0:\n return 1\n elif m % 2 == 0:\n nm2p = pow_mod(n, m//2, p)\n return (nm2p * nm2p) % p\n elif m % 2 == 1:\n return (pow_mod(n, m-1, p) * (n % p)) % p\n\ntot = 2 ** n - 1\n\ndef compute_ncr_mod(n, r, p):\n n...
['Wrong Answer', 'Accepted']
['s787851177', 's078367692']
[199320.0, 3064.0]
[2106.0, 152.0]
[586, 630]
p02768
u085717502
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['#!/usr/bin/env python\n# coding: utf-8\n\n# In[23]:\n\n\nn,a,b = map(int, input().split())\n\n\n# In[24]:\n\n\ndef nCk(n, k, mod):\n a = 1\n for i in range(n, n-k, -1):\n a *= i\n a %= mod\n b = 1\n for i in range(1, k+1):\n b *= i\n b %= mod\n a *= pow(b, mod-2, mod)\n r...
['Runtime Error', 'Runtime Error', 'Accepted']
['s675210342', 's699178453', 's398301005']
[9104.0, 9072.0, 9144.0]
[23.0, 24.0, 112.0]
[410, 388, 421]
p02768
u089142196
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b= map(int,input().split())\np=10**9+7\n\n\ndef framod(n, mod, a=1):\n for i in range(1,n+1):\n a=a * i % mod\n return a\n \ndef comb(n, k, mod):\n a=framod(n, mod)\n b=framod(k, mod)\n c=framod(n-k, mod)\n return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod\n \nA= comb(n,a,p)\...
['Wrong Answer', 'Accepted']
['s389380661', 's427670018']
[3064.0, 3064.0]
[2104.0, 111.0]
[439, 327]
p02768
u091852005
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input())\nm = 10 ** 9 + 7\n\ndef combn(n, r, m):\n X = Y = 1\n if n-r < r:\n r = n-r\n for i in range(1, r+1):\n Y = Y*i % m\n X = X*(n-i+1) % m\n Y = pow(Y, m-2, m)\n return X*Y\n \nprint((pow(2, n, m) - 1 - combn(n, a, m) - combn(n ,b, m)) % m)', 'n, a, b = ma...
['Runtime Error', 'Accepted']
['s899573929', 's116175860']
[3064.0, 3060.0]
[17.0, 143.0]
[289, 298]
p02768
u104282757
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['LARGE = 10 ** 9 + 7\n\n\ndef solve(n, a, b):\n\n pow_ab = [1] * (b + 1)\n for i in range(b):\n pow_ab[i + 1] = pow_ab[i] * (i + 1)\n pow_ab_inv = [1] * (b + 1)\n pow_ab_inv[-1] = pow(pow_ab[-1], LARGE - 2, LARGE)\n for i in range(b - 1, 0, -1):\n pow_ab_inv[i] = pow_ab_inv[i + 1] * (i + 1...
['Time Limit Exceeded', 'Accepted']
['s849460844', 's982835589']
[0.0, 18856.0]
[2278.0, 272.0]
[819, 875]
p02768
u106311097
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
["#!python3.4\n# -*- coding: utf-8 -*-\n# abc156/abc156_d\nimport sys\n\ns2nn = lambda s: [int(c) for c in s.split(' ')]\nss2nn = lambda ss: [int(s) for s in list(ss)]\nss2nnn = lambda ss: [s2nn(s) for s in list(ss)]\ni2s = lambda: sys.stdin.readline().rstrip()\ni2n = lambda: int(i2s())\ni2nn = lambda: s2nn(i2s())\nii2...
['Wrong Answer', 'Accepted']
['s920346806', 's575976615']
[10968.0, 10968.0]
[116.0, 115.0]
[1026, 999]
p02768
u106342872
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b = map(int, input().split())\n\nM = 10**9 + 7\n\nimport math\n\ndef my_pow(x, n):\n if n == 0:\n return 1\n if n % 2 == 0:\n return my_pow(x ** 2, n // 2) % M\n else:\n return x * my_pow(x ** 2, (n - 1) // 2) % M\n\nfrom scipy.misc import comb\n\nall_pattern = my_pow(2, n)\ndislike ...
['Time Limit Exceeded', 'Accepted']
['s114088259', 's828634706']
[222964.0, 9184.0]
[2112.0, 125.0]
[411, 324]
p02768
u106778233
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b =map(int,input().split())\nsum=0\nfor i in range(n) :\n if i == a :\n continue\n elif i == b :\n continue\n else :\n sum+=pow(n)/(pow(i)*pow(n-i))\n\nprint(sum%1000000007)', 'def com(n, r, mod):\n num = 1\n denom = 1\n for i in range(r):\n denom = (denom * (i+1)) % ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s286754856', 's319979700', 's469116132', 's701411100', 's970619906', 's812151791']
[2940.0, 3064.0, 3064.0, 7772.0, 3064.0, 3064.0]
[18.0, 143.0, 144.0, 2104.0, 143.0, 144.0]
[197, 321, 325, 243, 325, 325]
p02768
u111497285
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\n\nn = 10 ** 9\nk = 2 * 10 ** 5\nmod = 10**9 + 7\n\n\ndef power(x, a):\n if a == 0:\n return 1\n elif a == 1:\n return x\n elif a % 2 == 0:\n return power(x, a//2) **2 % mod\n else:\n return power(x, a//2) **2 * x % mod\n\n\n# https://qiita.c...
['Wrong Answer', 'Accepted']
['s566902374', 's042862871']
[3064.0, 3064.0]
[156.0, 156.0]
[934, 942]
p02768
u112317104
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['def ten_to_n(X, n):\n i = int(X / n)\n s = str(X % n)\n if (i):\n return ten_to_n(i, n) + s\n return s\n\ndef solve():\n N, M = map(int, input().split())\n n = ten_to_n(N, M)\n return len(n)\n \nprint(solve())\n', 'def solve():\n n, a, b = list(map(int, input().split()))\n MOD = 10 *...
['Runtime Error', 'Accepted']
['s513618350', 's500495228']
[2940.0, 27112.0]
[18.0, 247.0]
[226, 575]
p02768
u115110170
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['def comb_mod(n,m,mod):\n p = q = 1\n for i in range(m):\n p = p*(n-i) % mod\n q = q*(i+1) % mod\n return p* pow(q,mod-2,mod) % mod\n\nn,a,b = map(int,input().split())\n\nprint( (pow(2,n,mod)-1 -comb_mod(n,a,mod) -comb_mod(n,b,mod) ) % mod )', 'n,a,b = map(int,input().split())\nmod = 10**9+7\ndef framod(n, mo...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s477118710', 's935961000', 's969957415']
[3060.0, 199436.0, 3060.0]
[17.0, 2106.0, 143.0]
[240, 536, 255]
p02768
u123872895
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import math\n\nn, a, b = list(map(int, input().split()))\n\nMOD = 10**9 + 7\n\ndef make_fact_list(n, MOD):\n # make factorial list from 0 to n\n fact = [0] * (n+1)\n inv = [0] * (n+1)\n factinv = [0] * (n+1)\n\n fact[0]=fact[1]=1\n inv[1]=1\n factinv[0]=factinv[1]=1\n\n for i in range(2,n+1):\...
['Runtime Error', 'Accepted']
['s810596147', 's388205970']
[26868.0, 5460.0]
[189.0, 1498.0]
[1050, 322]
p02768
u130860911
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['Sn = pow(2,n,MOD) - 1\nif a > b:\n a,b = b,a\nXa, Xb = 1,1\nYa, Yb = 1,1\nfor i in range(b):\n if i < a:\n Xa = ( Xa * (n-i) ) % MOD\n Ya = ( Ya * pow((a-i),MOD-2, MOD)) % MOD\n Xb = ( Xb * (n-i) ) % MOD\n Yb = ( Yb * pow((b-i),MOD-2, MOD)) % MOD\n\nans = Sn - Xa*Ya % MOD - Xb*Yb % MOD\nwhil...
['Runtime Error', 'Accepted']
['s209060418', 's188976570']
[3064.0, 3064.0]
[18.0, 1607.0]
[346, 427]
p02768
u131406572
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['from scipy.special import comb', '#156D\n\ndef comb(n,r,p=7+10**9):\n bunshi = 1\n for i in range(n-r+1, n+1):\n bunshi =bunshi * i % p\n bunbo = 1\n for i in range(1, r+1):\n bunbo = bunbo * i % p\n return bunshi * pow(bunbo, p-2, p)\nn,a,b=map(int,input().split())\ns=-2+2**n-comb(n,a)-comb(n,b)\nprint(s%...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s494688931', 's556810647', 's875892652']
[14780.0, 199364.0, 3060.0]
[183.0, 2107.0, 116.0]
[30, 283, 280]
p02768
u131881594
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['MOD=10**9+7\n\ndef powmod(a,n,m): #a^n mod m\n ans=1\n while n!=0:\n if n&1: ans=ans*a%m\n a=a*a%m\n n>>=1\n return ans%m\n\ndef fact(n):\n ans=1\n for i in range(n): ans=ans*(i+1)%MOD\n return ans\n\ndef fact(a,b):\n ans=1\n for i in range(a,b+1): ans*=ans*i%MOD\n retu...
['Runtime Error', 'Accepted']
['s716509156', 's093210974']
[9516.0, 9172.0]
[2206.0, 106.0]
[500, 423]
p02768
u157020659
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['def mod_pow(x, n, mod):\n if n == 0:\n return 1\n if n % 2 == 1:\n return x * mod_pow(x, n - 1, mod) % mod\n else:\n return mod_pow(x, n // 2, mod) ** 2 % mod\n\ndef choose(n, m, mod):\n x, y = 1, 1\n for i in range(m):\n x = x * (n - i) % mod\n y = x * (i + 1) % mod\...
['Wrong Answer', 'Accepted']
['s388039037', 's008856403']
[3064.0, 3064.0]
[144.0, 144.0]
[495, 303]
p02768
u162612857
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = list(map(int, input().split()))\n\nmod = 10**9 + 7\n\nimport time\nstart = time.time()\n\n\n# https://qiita.com/Yaruki00/items/fd1fc269ff7fe40d09a6\ndef modinv(x):\n\treturn pow(x, mod-2, mod)\n\nmodinv_table = [-1] * (b+1)\nfor i in range(1, b+1):\n modinv_table[i] = modinv(i)\n\nend = time.time()\n# pr...
['Runtime Error', 'Accepted']
['s824931707', 's176999535']
[10932.0, 10944.0]
[800.0, 925.0]
[812, 815]
p02768
u163320134
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['mod=10**9+7\nn,a,b=map(int,input().split())\nans=pow(2,mod-2,mod)-1\ncomb1=1\nfor i in range(n,n-a,-1):\n comb1*=i\n comb1%=mod\nfor i in range(1,a+1):\n comb1*=pow(i,mod-2,mod)\n comb1%=mod\ncomb2=1\nfor i in range(n,n-b,-1):\n comb2*=i\n comb2%=mod\nfor i in range(1,b+1):\n comb2*=pow(i,mod-2,mod)\n comb2%=...
['Wrong Answer', 'Accepted']
['s021586754', 's742808043']
[3064.0, 3064.0]
[1613.0, 1604.0]
[344, 342]
p02768
u169350228
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int,input().split())\nmod = 10**9+7\n\ndef rev(x):\n re = 10**9+5\n num = 1\n ix = x\n while re > 0:\n if re%2 == 1:\n num = (num*ix)%mod\n re //= 2\n ix = (ix**2)%mod\n return(num)\n\ndef kaijo(x):\n num = 1\n for i in range(1,x+1):\n num = (n...
['Runtime Error', 'Accepted']
['s795922815', 's613496011']
[3064.0, 3064.0]
[2104.0, 160.0]
[608, 651]
p02768
u173148629
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b=map(int,input().split())\n\ndef comb(n,k,p):\n from math import factorial\n if n<0 or k<0 or n<k: return 0\n if n==0 or k==0: return 1\n a=factorial(n) %p\n b=factorial(k) %p\n c=factorial(n-k) %p\n return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p\ndef power_func(a,b,p):\n if b==0: return 1\n if b%...
['Wrong Answer', 'Accepted']
['s348177442', 's201921577']
[3064.0, 3064.0]
[2104.0, 148.0]
[582, 241]
p02768
u177182853
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import numpy as np\nimport math\n\ndef main(n, a, b):\n res = mod(2 ** n - comb(n, a) - comb(n, b) - 1)\n return res\n\ndef comb(n, k):\n res = mod(math.factorial(n)) / mod(math.factorial(n - k)) / mod(math.factorial(k))\n return res\n\ndef mod(n):\n mod = 10 ** 9 + 7\n res = n % mod\n return res...
['Wrong Answer', 'Accepted']
['s741523224', 's650571092']
[205520.0, 12496.0]
[2111.0, 2000.0]
[489, 780]
p02768
u178304274
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b = list(map(int,input().split()))\nkumiawase_bunshi = 1\nkumiawase_bunbo = 1\nt=0\nans = 0\nfor i in range (1,n+1):\n if(i != a and i != b):\n t=n\n for j in range (n-i+1,n+1):\n kumiawase_bunshi = kumiawase_bunshi * j\n for k in range (1,i+1):\n kumiawase_bunbo = ku...
['Runtime Error', 'Accepted']
['s027061864', 's285053596']
[3064.0, 3064.0]
[18.0, 159.0]
[472, 337]
p02768
u185325486
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b = map(int, input().split())\nif n/2 < a: a=n-a\nif n/2 < b: b=n-b\ntotal, combination = 0,1\n\nfor i in range(1,(n-1)//2+1):\n combination = combination*(n-i+1)/i\n total += combination\n if a == i: a_cnt = combination\n if b == i: b_cnt = combination\n \n total = total%(10**9+7)\n\nif n =...
['Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Accepted']
['s661180332', 's733827122', 's996174209', 's905250148']
[3064.0, 165760.0, 3064.0, 3064.0]
[2104.0, 2106.0, 2104.0, 135.0]
[491, 329, 405, 529]
p02768
u186838327
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a, b = map(int, input().split())\nmod = 10**9+7\n\n#print(x*pow(y,(mod-2),mod)%mod)\n\ndef conv(n, x, mod):\n X = 1\n for i in range(x):\n k = i+1\n X *= (n-k+1)*pow(k,(mod-2),mod)%mod\n X %= mod\n return X\n\ndef power_func(a,n,p):\n bi=str(format(n,"b"))\n res=1\n for i in range(...
['Runtime Error', 'Accepted']
['s228229226', 's580940806']
[3064.0, 9240.0]
[17.0, 133.0]
[1078, 544]
p02768
u186974762
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import numpy as np\nN,a,b = np.array(input().split()).astype(int)\nfor i in range(1,N+1):\n S = 0\n if((i!=a)&(i!=b)):\n S += math.factorial(N)/(math.factorial(i)*math.factorial(N-1))\nprint(S%(10**9+7))', 'import numpy as np\nimport math\nN,a,b = np.array(input().split()).astype(int)\n2**N-1-math.factorial(N)/(...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s079383048', 's276085746', 's483538076', 's563177368', 's572582140', 's617948887', 's625369037', 's913932548', 's098116472']
[12392.0, 18840.0, 16376.0, 12608.0, 3060.0, 3060.0, 12508.0, 2940.0, 3064.0]
[150.0, 2109.0, 2109.0, 150.0, 17.0, 17.0, 153.0, 17.0, 67.0]
[202, 199, 522, 241, 435, 183, 241, 208, 725]
p02768
u196746947
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['from math import factorial\nimport sys \nimport math\nsys.setrecursionlimit(400000000)\nmod=1000000007\nn,a,b=map(int,input().split())\ndef power(x,y):\n count=1\n rem=x\n while 2*count<y:\n x=x**2\n x=x%mod\n count*=2\n res=y-count\n return x*(pow(rem,res))%mod\n\ndef nck(x,y):\n ...
['Wrong Answer', 'Accepted']
['s753647784', 's005447345']
[153848.0, 3064.0]
[2105.0, 142.0]
[474, 399]
p02768
u201387466
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import sys\ninput=sys.stdin.readline\n#from collections import defaultdict\n\n#import fractions\n#import math\n#import collections\n#from collections import deque\n\n#N = int(input())\n#A = list(map(int,input().split()))\n#S = list(input())\n#S.remove("\\n")\n#N,M = map(int,input().split())\n#S,T = map(str,input().sp...
['Runtime Error', 'Accepted']
['s777005163', 's005209980']
[3188.0, 3064.0]
[19.0, 144.0]
[868, 890]
p02768
u201928947
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['\nfrom functools import reduce\nmod = 10**9+7\ndef mul(a,b):\n return a*b % mod\ndef cmb(n,r,mod):\n if r == 0:\n return 1\n r = min(n-r,r)\n above = reduce(mul,range(n-r+1,n+1)) \n below = reduce(mul,range(1,r+1)) \n ans = above*pow(below,mod-2,mod) % mod\n if ans < 0:\n ans += mod\n...
['Runtime Error', 'Accepted']
['s359130894', 's498215386']
[3064.0, 9188.0]
[17.0, 126.0]
[445, 339]
p02768
u207137484
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b = (int(x) for x in input().split())\nmod = 10**9+7\n\ndef minus(n,k):\n x,y =1,1\n for i in range(k):\n x*=(n-i)%mod\n y*=(k-i)%mod\n return x*pow(y, mod-2, mod)%mod\n\nans = pow(2,n,mod)-1-minus(b,a)-minus(b,b)\nwhile ans<0:\n ans+=mod\nprint(ans)\n', 'n,a,b = map(int, input().split()...
['Wrong Answer', 'Accepted']
['s511072917', 's671765816']
[3588.0, 3064.0]
[2104.0, 151.0]
[268, 283]
p02768
u212786022
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n, a ,b = map(int, input().split())\n\nmod = 1000000007\nwidth = 1000\ntable = [ 1, 128233642, 993191796, 246084337, 175673566, 883787401, 470931556, 119995528, 225567908, 757928892, 250015370, 913979655, 754758, 207715304, 680281231, 630322311, 642314838, 834078844, 599226039, 918470969, 777847830, 188150013, 936569...
['Runtime Error', 'Accepted']
['s761094497', 's293615413']
[3832.0, 3832.0]
[19.0, 473.0]
[11579, 11583]
p02768
u219015402
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['\nn,a,b = map(int,input().split())\n\nres = 1\n \ndef cmb(n, r):\n if (r < 0 or r > n):\n return 0\n r = min(r, n-r)\n return fac[n] * finv[r] * finv[n-r] % mod\n \n \nmod = 10**9+7 \nN_cmb = 0\nN_cmb += n \nfac = [1, 1] \nfinv = [1, 1] \ninverse = [0, 1] 計算用テーブル\n\nfor ZZZ in range(2, N_cmb + 1):...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s511475346', 's669897149', 's300283910']
[218544.0, 9280.0, 3064.0]
[2119.0, 2104.0, 133.0]
[747, 578, 282]
p02768
u219417113
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['def pre_cmb_mod(n, mod):\n if n == 0:\n return [1], [1]\n fact = [1, 1]\n inv = [0, 1]\n factinv = [1, 1]\n for i in range(2, n+1):\n fact.append((fact[-1] * i) % mod)\n inv.append((-inv[mod % i] * (mod//i)) % mod)\n factinv.append((factinv[-1] * inv[-1]) % mod)\n return ...
['Runtime Error', 'Accepted']
['s684927147', 's955576045']
[3064.0, 3064.0]
[17.0, 151.0]
[736, 431]
p02768
u221149873
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['import math\nn, a, b = map(int,input().split())\nprint((n**2 - math.factorial(n)/(math.factorial(a)*math.factorial(n-a)) - math.factorial(n)/(math.factorial(b)*math.factorial(b-a)))%(10**9+7))', 'def mod_power(x,y,p):\n if y == 1:\n return x % p\n elif y % 2 == 0:\n return (mod_power(x,y/2,p)**2) ...
['Wrong Answer', 'Accepted']
['s358401360', 's284810715']
[7684.0, 3064.0]
[2104.0, 133.0]
[190, 514]
p02768
u223904637
2,000
1,048,576
Akari has n kinds of flowers, one of each kind. She is going to choose one or more of these flowers to make a bouquet. However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b. How many different bouquets are there that Akari can make? Find the count modulo (10^9 + 7). Here,...
['n,a,b=map(int,input().split())\nmod=10**9+7\nans=pow(2,n,mod)-1\np=1\nfor i in range(a):\n p*=n-i\n p*=pow(i+1,mod-2,mod)\n p%=mod\nfor i in range(b):\n p*=n-i\n p*=pow(i+1,mod-2,mod)\n p%=mod\nprint((ans-p)%mod)', 'n,a,b=map(int,input().split())\nmod=10**9+7\nans=pow(2,n,mod)-1\np=1\nfor i in range...
['Wrong Answer', 'Accepted']
['s034122329', 's789877198']
[3064.0, 3064.0]
[1573.0, 1587.0]
[218, 230]