Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02811 (python)

Fixed submission:
K, X = map(int, input().split())

if K * 500 >= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
C = list(map(int, input().split()))

C.sort()

ans = 0

mod = 10 ** 9 + 7

pattern = (2 ** (N - 2)) % mod

if N != 1:
    for i in range(N):
        c = C[i]
        ans += c * (N + 1 - i) * pattern
        ans %= mod
    ans *= 2 ** N
else:
    ans = C[0] * 2

ans %= mod

print(ans)
Problem p02817 (python)

Fixed submission:
S, T = input().split()
print(T + S)

Buggy submission (verdict: Runtime Error):
S, T = input.split()
print(T + S)
Problem p02818 (python)

Fixed submission:
A, B, K = map(int,input().split())

if A >= K:
  A -= K
else:
  B = max(0, A + B - K)
  A = 0

print(str(A) + " " + str(B))

Buggy submission (verdict: Runtime Error):
A, B, K = map(int,input().split())

if A > K:
  A -= K
else:
  A = 0
  B = max(0, A + B - K)

print(A + " " + B)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int,input().split())

if A > K:
  A -= K
else:
  A = 0
  B = max(0, A + B - K)

print(A + " " + B)
Problem p02885 (python)

Fixed submission:
A, B = map(int,input().split())
print(max(0, A - B * 2))

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
print(max(0, a - B * 2))
Problem p03024 (python)

Fixed submission:
s = input()

win = 0
lose = 0

for c in s:
    if c == "o":
        win += 1
    else:
        lose += 1

days = 15 - (win + lose)

if win + days >= 8:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
s=input()

win=0
lose=0

for c in s:
  if c = "o":
    win+=1
  else:
    lose+=1

if win + ( 15 - ( win + lose ) ) > 8:
  print("YES")
else:
  print("NO")
Problem p03699 (python)

Fixed submission:
N = int(input())

S = [int(input())for _ in range(N)]
S.sort()

S_all = sum(S)

if S_all % 10 != 0:
    print(S_all)
    exit()

i = 0
while i < N and S[i] % 10 == 0:
    i += 1

if i != N:
    print(S_all - S[i])
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())

S = [int(input())for _ in range(N)]
S.sort()

S_all = sum(S)

if S_all % 10 != 0:
    print(S_all)
    exit()

i = 0
while S[i] % 10 == 0:
    i += 1

print(S_all - S[i])
Problem p04001 (python)

Fixed submission:
s = input()

max_plus = len(s) - 1

numList = [int(c) for c in s]

sMax = (1 << max_plus) - 1

ans = 0

for plus_pos in range(sMax + 1):
    sum = 0

    num = numList[0]

    for i in range(max_plus):
        if ((plus_pos >> i) & 1) == 1:
            sum += num
            num = numList[i + 1]
        else:
            num = num * 10 + numList[i + 1]

    sum += num
    ans += sum

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()

max_plus = len(s) - 1

numList = [int(c) for c in s]

sMax = (1 << max_plus) - 1

ans = 0

for plus_pos in range(sMax + 1):
    sum = 0

    num = numList[0]

    for i in range(max_plus):
        if ((plus_pos >> i) & 1) == 1:
            sum += num
            num = numList[i + 1]
        else:
            num = num * 10 + numList[i + 1]

    sum += num
    ans += sum

print(ans)s = input()

max_plus = len(s) - 1

numList = [int(c) for c in s]

sMax = (1 << max_plus) - 1

ans = 0

for plus_pos in range(sMax + 1):
    sum = 0

    num = numList[0]

    for i in range(max_plus):
        if ((plus_pos >> i) & 1) == 1:
            sum += num
            num = numList[i + 1]
        else:
            num = num * 10 + numList[i + 1]

    sum += num
    ans += sum

print(ans)
Problem p02675 (python)

Fixed submission:
n = int(input())
ones = n % 10 

if ones == 2 or ones == 4 or ones == 5 or ones == 7 or ones == 9:
    print("hon")
elif ones == 0 or ones == 1 or ones == 6 or ones == 8:
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
newarr = input()
newarr = newarr.split()
n = int(newarr[0])
m = int(newarr[1])
dicts = {}
ans = [0] * (n + 1)
for line in range(m):
    newarr = input()
    newarr = newarr.split()
    froom = int(newarr[0])
    sroom = int(newarr[1])
    if froom not in dicts:
        dicts[froom] = []
    if sroom not in dicts:
        dicts[sroom] = []
    dicts[froom].append(sroom)
    dicts[sroom].append(froom)
queue = []
if 1 not in dicts:
    print("No")
else:
    ans[1] = 1
    curarr = dicts[1]
    for i in curarr:
        queue.append(i)
        ans[i] = 1 
    while queue:
        curitem = queue.pop(0)
        if curitem not in dicts:
            continue 
        curarr = dicts[curitem]
        for i in curarr:
            if ans[i] == 0:
                ans[i] = curitem 
                queue.append(i)

    finalans = []
    flag = 0 
    for i in range(2, n + 1):
        if i == 0 :
            flag = 1 
            break 
        finalans.append(ans[i])
    if flag == 1:
        print("No")
    else:
        print("Yes")
        for i in finalans:
            print(i)
Problem p03160 (python)

Fixed submission:
n = int(input())
arr1 = str( input() )
arr1 = arr1.split()
arr = []

for i in arr1:
    arr.append(int(i))

leng = len(arr)
dp = [99999999999] * leng 
dp[0] = 0 

for i in range(leng):
    if (i + 1) >= leng:
        continue 
    dp[i + 1] = min ( dp[i] + abs(arr[i] - arr[i + 1]), dp[i + 1] )
    
    if (i + 2) >= leng:
        continue 
    dp[i + 2] = min(  ( dp[i] + abs( arr[i] - arr[i + 2] ) , dp[i + 2]) )

print(dp[-1])

Buggy submission (verdict: Runtime Error):
strs = str(input())
arr1 = strs.split()
stone = int(arr1[0])
times = int(arr1[1])
arr1 = str(input())
arr1 = arr1.split()
arr = []
for i in arr1:
    arr.append(int(i))
cost = [9999999] * stone
cost[0] = 0
for i in range(stone):
    if i == (stone - 1):
        break
    if i == 0:
        for j in range(i+1 ,times + 1):
            if j >= stone:
                break
            kkt = arr[0] - arr[j]
            cost[j] = min(cost[j], abs(kkt))
    else:
        for j in range(i+1 ,i +1+ times):
            if j >= stone:
                break
            kkt = arr[i] - arr[j]
            tj = ( abs(kkt) + cost[i])
            #print(tj)
            cost[j] = min(cost[j], tj )
    #print(cost)
if cost[-1] == 9999999:
    print(0)
else:
    print(cost[-1])

Buggy submission (verdict: Runtime Error):
strs = str(input())
arr1 = strs.split()
stone = int(arr1[0])
times = int(arr1[1])
arr1 = str(input())
arr1 = arr1.split()
arr = []
for i in arr1:
    arr.append(int(i))
cost = [9999999] * stone
cost[0] = 0
for i in range(stone):
    if i == (stone - 1):
        break
    if i == 0:
        for j in range(i+1 ,times + 1):
            if j >= stone:
                break
            kkt = arr[0] - arr[j]
            cost[j] = min(cost[j], abs(kkt))
    else:
        for j in range(i+1 ,i +1+ times):
            if j >= stone:
                break
            kkt = arr[i] - arr[j]
            tj = ( abs(kkt) + cost[i])
            #print(tj)
            cost[j] = min(cost[j], tj )
    #print(cost)
if cost[-1] == 9999999:
    print(0)
else:
    print(cost[-1])
Problem p03164 (python)

Fixed submission:
'''

                            Online Python Compiler.
                Code, Compile, Run and Debug python program online.
Write your code in this editor and press "Run" button to execute it.

'''

firstline = str(input())
firstline = firstline.split()
n = int( firstline[0] )
total = int( firstline[1] )

maxvalue = int( pow(10, 5) + 1)
#maxvalue = 100
colums = [10000000001000000000 for _ in range(maxvalue)]
dp = [ colums[::] for _ in range(n+1) ]

for i in range(n+1):
    dp[i][0] = 0

stone = []

for i in range(n):
    getInput = str(input())
    getInput = getInput.split()
    stone.append(( int(getInput[1]) , int(getInput[0]) ) )

stone = sorted(stone)

index = 0
for currentstone in stone:
    currentvalue = currentstone[0]
    currentweight = currentstone[1]
    index += 1 
    for V in range(1, maxvalue):
        if currentvalue <= V:
            dp[index][V] = min(currentweight + dp[index-1][V - currentvalue], dp[index - 1][V])
        else:
            dp[index][V] = dp[index-1][V]

bestvalue = 0
for i in range(1, maxvalue ):
    if dp[n][i] <= total and dp[n][i] !=9999999 :
        bestvalue = i
#print(stone)
#
print(bestvalue)

Buggy submission (verdict: Runtime Error):
firstline = str(input())
firstline = firstline.split()
item = int( firstline[0] )
totalweight = int ( firstline[1] )
gh = [0] * (totalweight + 1)
dp = [gh[::] for _ in range(item) ]
total = []

def sort_tuple(tup):  
  
    tup.sort(key = lambda x: x[0])  
    return tup  

for i in range(item):    
    getIn = str(input())
    getIn = getIn.split()
    total.append( ( int( int(getIn[0]) ), int( getIn[1]) ) )
    
sort_tuple(total)
#print(total)

firstStone = total[0]
for i in range(firstStone[0], totalweight+1 ):
    dp[0][i] = firstStone[1]

for i in range(1, item):
    currentStone = total[i]
    currentStoneWeight = currentStone[0]
    currentStoneValue = currentStone[1]
    for j in range(0, totalweight + 1):
        dp[i][j] = max( dp[i - 1][j], dp[i][j]   )
        if j >= currentStoneWeight:
            dp[i][j] = max( dp[i][j], currentStoneValue + dp[i - 1][j - currentStoneWeight] )
#print(dp)
print(dp[-1][-1])
Problem p02658 (python)

Fixed submission:
import sys

N = int(input())
A = list(map(int,input().split()))
cnt = 1

for i in range(N):
    if(A[i] == 0):
        print(0)
        sys.exit()

for i in range(N):
    cnt *= A[i]
    if(cnt > 1e18):
        print(-1)
        sys.exit()

if(cnt <= 1e18):
    print(cnt)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
cnt = 1

for i in range(N):
    cnt *= A[i]
    if(cnt > 1e18):
	print(-1)
	sys.exit()

if(cnt <= 1e18):
    print(cnt)
else:
    print(-1)
Problem p02584 (python)

Fixed submission:
X,K,D = map(int,input().split())
if X > 0:
  if X-D*K > 0:
    print(X-D*K)
  elif (X//D - K) %2==0:
    print(min(abs(X-(X//D)*D),abs(X-((X//D)+2)*D)))
  else:
    print(min(abs(X-((X//D)-1)*D),abs(X-((X//D)+1)*D)))
elif X == 0:
    if K%2 == 0:
        print(0)
    else:
        print(D)
else:
    if X+D*K < 0:
        print(abs(X+D*K))
    elif ((-X)//D - K) %2==0:
        print(min(abs(X+((-X)//D)*D),abs(X+(((-X)//D)+2)*D)))
    else:
        print(min(abs(X+(((-X)//D)-1)*D),abs(X+(((-X)//D)+1)*D)))

Buggy submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
if X > 0:
  if X-D*K > 0:
    print(X-D*K)
  elif (X//D - K) %2==0:
    print(min(abs(X-(X//D)*D),abs(X-((X//D)+2)*D)))
  else:
    print(min(abs(X-(X//D-1)*D),abs(X-(X//D+1)*D)))
elif X == 0:
  if K%2 == 0:
    print(0)
  else:
    pritn(D)
else:
  if X-D*K < 0:
    print(abs(X-D*K))
  elif (X// - K) %2==0:
    print(min(abs(X-(X//D)*D),abs(X-((X//D)+2)*D)))
  else:
    print(min(abs(X-(X//D-1)*D),abs(X-(X//D+1)*D)))
Problem p02658 (python)

Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    length = 1
    limit = 10 ** 18
    if 0 in A:
        print(0)
        return
    for i in range(N):
        length = length *  A[i]
        if length > limit:
            print('-1')
            return
    print(length)
    return
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
length = 1
limit = 10 ** 18
for i in range(N):
    length = length *  A[i]
    if length > limit:
        print('-1')
        break
    if i == N-1:
        print(length)
Problem p02813 (python)

Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
cnt, a, b = 0, 0, 0
for i in itertools.permutations(range(1, N+1)):
    if P == i:
        a = cnt
        if b != 0:
            break
    if Q == i:
        b = cnt
        if a != 0:
            break
    cnt += 1
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
cnt, a, b = 0, 0, 0
for i in itertools.permutations(range(1, N+1)):
    if P == i:
        a = cnt
        if b != 0:
            break
    if Q == i:
        b = cnt
        if a != 0:
            break
    cnt += 1
print(abs(a-b))
Problem p02861 (python)

Fixed submission:
N = int(input())
A = [tuple(map(int, input().split())) for _ in range(N)]
ans = []
import numpy as np
import itertools
for zyun in itertools.permutations(range(N)):
    cnt = 0
    for k in range(len(zyun)-1):
        cnt += np.sqrt((A[zyun[k+1]][0]-A[zyun[k]][0])**2+(A[zyun[k+1]][1]-A[zyun[k]][1])**2 )
    ans.append(cnt)
print(sum(ans) / len(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [tuple(map(int, input().split())) for _ in range(N)]
ans = []
import numpy as np
for zyun in itertools.permutations(range(N)):
    cnt = 0
    for k in range(len(zyun)-1):
        cnt += np.sqrt((A[zyun[k+1]][0]-A[zyun[k]][0])**2+(A[zyun[k+1]][1]-A[zyun[k]][1])**2 )
    ans.append(cnt)
print(sum(ans) / len(ans))
Problem p03031 (python)

Fixed submission:
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(tuple(map(int, input().split())))
P = tuple(map(int, input().split()))
import itertools
def hantei(A, RETU, P):
    for i in range(len(A)):
        count = 0
        for k in RETU:
            if k in A[i][1:]:
                count += 1
        if not count % 2 == P[i]:
            return False
    return True
ans = 0
for i in range(1, N + 1):
    for k in itertools.combinations(range(1, N + 1), i):
        if hantei(A, k, P):
            ans += 1
if hantei(A, [0], P):
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(tuple(map(int, input().split())))
P = tuple(map(int, input().split()))
import itertools
def hantei(A, RETU, P):
    for i in range(len(A)):
        count = 0
        for k in RETU:
            if k in A[i][1:]:
                count += 1
        if not count % 2 == P[i]:
            return False
    return True
ans = 0
for i in range(1, N + 1):
    for k in itertools.combinations(range(1, N + 1), i):
        if hantei(A, k, P):
            ans += 1
if hantei(A, 0, P):
    ans += 1
print(ans)
Problem p03476 (python)

Fixed submission:
ALL = []
cnt = 0
import math
def decide_sosuu(n):
    if n <= 1:
        return False
    else:
        for i in range(2, int(math.sqrt(n)) + 1):
            if n % i == 0:
                return False
    return True
for i in range(1,int((10**5)/2+2)):
    if decide_sosuu(i):
        if decide_sosuu((i*2)-1):
            cnt += 1
            ALL.append(cnt)
        else:
            ALL.append(cnt)
    else:
        ALL.append(cnt)
Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    if l == 1:
        print(ALL[int(r/2)])
    else:
        print(ALL[int(r/2)] -ALL[int(l/2)-1])

Buggy submission (verdict: Runtime Error):
ALL = []
cnt = 0
import math
def decide_sosuu(n):
    if n <= 1:
        return False
    else:
        for i in range(2, int(math.sqrt(n)) + 1):
            if n % i == 0:
                return False
    return True
for i in range(1,int((10**5)/2)):
    if decide_sosuu(i):
        if decide_sosuu((i*2)-1):
            cnt += 1
            ALL.append(cnt)
        else:
            ALL.append(cnt)
    else:
        ALL.append(cnt)
Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    if l == 1:
        print(ALL[int(r/2)])
    else:
        print(ALL[int(r/2)] -ALL[int(l/2)-1])

Buggy submission (verdict: Runtime Error):
ALL = []
cnt = 0
import math
def decide_sosuu(n):
    if n <= 1:
        return False
    else:
        for i in range(2, int(math.sqrt(n)) + 1):
            if n % i == 0:
                return False
    return True
for i in range(1,int((10**5)/2)):
    if decide_sosuu(i):
        if decide_sosuu((i*2)-1):
            cnt += 1
            ALL.append(cnt)
        else:
            ALL.append(cnt)
    else:
        ALL.append(cnt)
Q = int(input())
for _ in range(Q):
    l, r = map(int, input().split())
    print(ALL[int(r/2)] -ALL[int(l/2)-1])
Problem p03557 (python)

Fixed submission:
import sys
import bisect

def main():
    input = sys.stdin.buffer.readline
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    B = list(map(int, input().split()))
    B.sort()
    C = list(map(int, input().split()))
    C.sort()
    ans = 0
    for i in B:
        a = bisect.bisect_left(A, i)
        c = bisect.bisect_right(C, i)
        ans += a*(N-c)
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
import bisect

def main():
    input = sys.stdin.buffer.readline
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    B = list(map(int, input().split()))
    B.sort()
    C = list(map(int, input().split()))
    ans = 0
    for i in B:
        a = bisect.bisect_left(A, b)
        c = bisect.bisect_right(C, b)
        ans += a*(N-c)
    print(sum(A_count))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A_count = [0] * len(A)
B_count = [0] * len(B)
for i in range(len(B)):
    B_count[i] = len(C) - bisect(C, B[i])
for i in range(len(A)):
    A_count[i] = sum(B_count[bisect(B, A[i]):])
print(sum(A_count))
Problem p02574 (python)

Fixed submission:
import numpy as np
N = int(input())
A = list(map(int,input().split()))
cnt = [0] * (10**6 + 1)
for i in range(N):
    cnt[A[i]] += 1

maxcount = 0
for i in range(2,10**6+1):
    maxcount = max(maxcount,sum(cnt[i::i]))

if np.gcd.reduce(A) != 1:
    print('not coprime')
elif maxcount <= 1:
    print('pairwise coprime')
else:
    print('setwise coprime')

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

def divisors(n):
	div = [1, n]
	
	for i in range(2, int(n**0.5)+1):
		if n % i == 0:
			div.append(i)
			if i != n//i:
				div.append(n//i)
	
	return div

flag = False
inter = set(divisors(A[0]))
union = set(divisors(A[0]))
s = len(set(divisors(A[0])))
for i in range(1,N):
    div = set(divisors(A[i]))
    s += len(div)
    inter &=  div
    union |= div
    print(s,inter,union)
if len(union) == s - N + 1:
    print('pairwise coprime')
elif inter == {1}:
    print('setwise coprime')
else:
    print('not coprime')
Problem p02642 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
l = [0] * A[-1]
for i in range(N):
    l[A[i] - 1] += 1
for i in range(N):
    if l[A[i] - 1] > 1:
        l[A[i] - 1] = 0
    elif l[A[i] - 1] == 0:
        continue
    temp = A[i]
    while True:
        temp += A[i]
        if temp > A[-1]:
            break
        l[temp - 1] = 0
print(sum(l))

Buggy submission (verdict: Runtime Error):
import sympy
from collections import deque

N = int(input())
A = list(map(int,input().split()))
if len(set(A)) == 1:
    print(0)
else:
    counter = 0
    A.sort()
    d = deque(A)
    for i in range(len(d)):
        p = d.popleft()
        divs = sympy.divisors(p)
        if set(divs) & set(d) == set():
            counter += 1
        d.append(p)
    print(counter)
Problem p02683 (python)

Fixed submission:
N,M,X = map(int,input().split())
C = []
for i in range(N):
    C.append(list(map(int,input().split())))

cost = 100000000000000000000000
l = list(range(1,N+1))
import itertools
for i in range(1,N+1):
    check_l = list(itertools.combinations(l,i))
    for a in check_l:
        sub_list = [0] * (M + 1)
        for j in range(i):
            for k in range(M+1):
                sub_list[k] += C[a[j]-1][k]
        flag = True
        for p in range(M):
            if sub_list[p+1] < X:
                flag = False
        if flag == True:
            if cost > sub_list[0]:
                cost = sub_list[0]

if cost == 100000000000000000000000:
    print(-1)
else:
    print(cost)

Buggy submission (verdict: Runtime Error):
N,M,X = map(int,input().split())
C = []
for i in range(N):
    C.append(list(map(int,input().split())))

cost = 100000000000000000000000
l = list(range(1,N+1))
import itertools
for i in range(1,N+1):
    check_l = list(itertools.combinations(l,i))
    for a in check_l:
        sub_list = [0] * (M + 1)
        for j in range(i):
            for k in range(M+1):
                sub_list[k] += C[a[i]-1][k]
        flag = True
        for p in range(M):
            if sub_list[p+1] < X:
                flag = False
        if flag == True:
            if cost > sub_list[0]:
                cost = sub_list[0]

if cost == 100000000000000000000000:
    print(-1)
else:
    print(cost)
Problem p02768 (python)

Fixed submission:
def cmb(n, r):
	if n - r < r:
		r = n - r
	if r == 0:
		return 1
	if r == 1:
		return n
	
	num = [n - r + k + 1 for k in range(r)] #numerator(分子)
	den = [k + 1 for k in range(r)] #denominator(分母)
	
	for p in range(2, r + 1):
		pivot = den[p - 1]
		if pivot > 1:
			offset = (n - r) % p
			for k in range(p - 1, r, p):
				num[k - offset] /= pivot
				den[k] /= pivot
	
	result = 1
	for k in range(r):
		if num[k] > 1:
			result *= int(num[k])
			result = result % mod
	
	return result

n,a,b = map(int,input().split())
mod = 10**9+7

print((pow(2,n,mod) - 1 - cmb(n,a) - cmb(n,b)) % mod)

Buggy submission (verdict: Runtime Error):
    def cmb(n, r):
    	if n - r < r:
    		r = n - r
    	if r == 0:
    		return 1
    	if r == 1:
    		return n
    	
    	num = [n - r + k + 1 for k in range(r)] #numerator(分子)
    	den = [k + 1 for k in range(r)] #denominator(分母)
    	
    	for p in range(2, r + 1):
    		pivot = den[p - 1]
    		if pivot > 1:
    			offset = (n - r) % p
    			for k in range(p - 1, r, p):
    				num[k - offset] /= pivot
    				den[k] /= pivot
    	
    	result = 1
    	for k in range(r):
    		if num[k] > 1:
    			result *= int(num[k])
    	
    	return result
     
    n,a,b = map(int,input().split())
     
    print((2**n - 1 - cmb(n,a) - cmb(n,b)) % (10**9 + 7))

Buggy submission (verdict: Runtime Error):
    n,a,b = map(int,input().split())
    mod = 10**9+7
     
    from math import factorial
    cmb_a = factorial(n) / factorial(a) / factorial(n-a)
    cmb_b = factorial(n) / factorial(b) / factorial(n-b)
     
    print(int((2**n - 1 - cmb_a - cmb_b) % mod))
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
count = 0
answer = 0

for i in range(N - 1):
	if H[i + 1] <= H[i]:
		count = count + 1
	else:
		if answer < count:
			answer = count
			count = 0
		else:
			count = 0

if answer < count:
	answer = count
	
print(answer)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
C = [0] * (N - 1)

for i in range(N - 1):
	if H[i + 1] <= H[i]:
		C[i] = 1

for i in range(N-2):
	if 0 < C[i + 1]:
		C[i + 1] = C[i] + C[i + 1]

print(max(C))
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

import fractions

def lcm(x, y):
	return (x * y) // fractions.gcd(x, y)

E = lcm(C, D)

n_a = (A - 1) // C + (A - 1) // D - (A - 1) // E
n_b = B // C + B // D - B // E

print((B - A + 1) - (n_b - n_a))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

import math

def lcm(x, y):
	return (x * y) // math.gcd(x, y)

E = lcm(C, D)

n_a = (A - 1) // C + (A - 1) // D - (A - 1) // E
n_b = B // C + B // D - B // E

print((B - A + 1) - (n_b - n_a))
Problem p02628 (python)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(k):
    ans += p[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
ans = 0
for i in range(K):
    ans += p[i]
    
print(m)