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

Fixed submission:
X=int(input())

if X>=30:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,D = int(input().split())
count=0
for _ in range(N):
  p,q=int(input().split())
  if (p*p + q*q)<=D*D:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,D = int(input().split(" "))
count=0
for _ in range(N):
  p,q=int(input().split(" "))
  if (p*p + q*q)<=D*D:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split(" "))
count=0
for _ in range(N):
  p,q=map(int,input().split(" "))
  if (p*p + q*q)<=D*D:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import math
N,D = map(int,input().split(" "))
count=0
for _ in range(N):
  p,q=map(int,input().split(" "))
  if (p*p + q*q)<=D*D:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):

N,D = map(int,input().split(" "))
 
for _ in range(N):
  count=0
  p,q=map(int,input().split(" "))
  if (p**2 + q**2) <=D**2:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import math
N,D = map(int,input().split(" "))
 
for _ in range(N):
  count=0
  p,q=map(int,input().split(" "))
  if (p**2 + q**2)**0.5 <=D**2:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,D = map(int,input().split())
 
for _ in range(N):
  count=0
  p,q=map(int,input().split())
  if (p**2 + q**2)**0.5 <=D:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
if X>=30:
  print("Yes")
else:
  print("No")
Problem p02550 (python)

Fixed submission:
import sys

input = sys.stdin.readline

N, X, M = map(int, input().split())
LIST = [X]
SET = {X}

a = X

while True:
    if a * a % M in SET:
        break
    else:
        a = a * a % M
        LIST.append(a)
        SET.add(a)

# 繰り返しがaから始まる
# SETには順番が記録されていないのでLISTを使う
start = LIST.index(a * a % M)
LEN = len(LIST)

if N <= LEN:
    print(sum(LIST[:N]))
else:
    LoopTimes, Excess = divmod(N-LEN, LEN-start)
    LoopSum = sum(LIST[start:]) * LoopTimes
    ExSum = sum(LIST[start:start+Excess])
    print(sum(LIST[:]) + LoopSum + ExSum)

Buggy submission (verdict: Runtime Error):
n, x, m = map(int, input().split())

def main(a):
    if a == 1:
        return x
    if a >= 2:
        return (main(a-1)**2) % m

ans = 0
for i in range(1, n+1):
    ans += main(i)
print(ans)
Problem p02552 (python)

Fixed submission:
n = int(input())
print("1" if n == 0 else "0")

Buggy submission (verdict: Runtime Error):
n = int(input())
print("1" if x == 0 else "0")
Problem p02627 (python)

Fixed submission:
a = str(input())
if a.isupper() == True:
    print("A")
else:
    print("a")

Buggy submission (verdict: Runtime Error):
a = str(input())
if a.isupper() == True:
    print(A)
else:
    print(a)
Problem p02699 (python)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split())
if (s >= w):
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split())
if s > w:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):
S,W = map(int, input().split())
if S > W:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):
S,W = map(int, input().split())
if S > W:
    print(safe)
else:
    print(unsafe)

Buggy submission (verdict: Runtime Error):
S,W = map(int,input().split())
if S > W: print(safe)
else: print(unsafe)

Buggy submission (verdict: Runtime Error):
S,W = input()
if S > W: print(safe)
else: print(unsafe)
Problem p02712 (python)

Fixed submission:
FizzBizz = int(input())

Sum = []
for i in range(1, FizzBizz+1):
    if i % 3 != 0 and i % 5 != 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))

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

Sum = []
for i in range(FizzBizz):
    if FizzBuzz[i] % 3 == 0 and FizzBuzz[i] % 5 == 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))
Problem p02552 (python)

Fixed submission:
x=int(input())
if x==0:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
x=int(input())
if x=0:
    print(1)
else:
    print(0)
Problem p02578 (python)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
cnt=0
for i in range(1,n):
    if a[i-1]>a[i]:
        cnt+=a[i-1]-a[i]
        a[i]=a[i-1]
print(cnt)

Buggy submission (verdict: Runtime Error):
5
3 3 3 3 3
Problem p02623 (python)

Fixed submission:
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
asum=[0]
bsum=[0]
for i in range(n):
    asum.append(asum[-1]+a[i])
for i in range(m):
    bsum.append(bsum[-1]+b[i])
ans=0
for i in range(n+1):
    if asum[i]>k:
        break
    while asum[i]+bsum[m]>k and m>0:
        m-=1
    ans=max(ans,i+m)
print(ans)

Buggy submission (verdict: Runtime Error):
#C
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
asum=[0]
bsum=[0]
for i in range(n):
    asum.append(asum[-1]+a[i])
for i in range(m):
    bsum.append(bsum[-1+b[i]])
ans=0
for i in range(n+1):
    if asum[i]>0:
        break
    while asum[i]+bsum[m]>0 and m>0:
        m-=1
    ans=(ans,i+m)
print(ans)
Problem p03250 (python)

Fixed submission:
num = list(map(int, input().split()))
num.sort(reverse=True)
a = str(num[0])
b = str(num[1])
c = int(num[2])
ab = a + b
ab = int(ab)
print(ab + c)

Buggy submission (verdict: Runtime Error):
num = list(map(int, input().split()))
num.sort(reverse=True)
a = str(num[0])
b = str(num[1])
c = int(num[2])
ab = a + b
ab = int("ab")
print(ab + c)
Problem p03327 (python)

Fixed submission:
n = int(input())
if n > 999:
    print("ABD")
    exit()
print("ABC")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = b - a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=b-a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
n = b - a
print(int(n*(n+1)/2-b))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = int(((b-a)*(b-a+1)/2)-b)
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
ans = int(((b-a)*(b-a+1)/2)-b)
print(ans)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(((b-a)*(b-a+1)/2)-b)
Problem p02689 (python)

Fixed submission:
import sys
input=sys.stdin.readline

N,M=(int(x) for x in input().rstrip('\n').split())
Hs = [int(x) for x in input().rstrip('\n').split()]
nums = [1 for x in Hs]
for i in range(M):
  roads = [int(x) for x in input().rstrip('\n').split()]
  if Hs[roads[0]-1] < Hs[roads[1]-1]:
    nums[roads[0]-1] = 0
  elif Hs[roads[0]-1] > Hs[roads[1]-1]:
    nums[roads[1]-1] = 0
  else:
    nums[roads[0]-1] = 0
    nums[roads[1]-1] = 0
print(sum(nums))

Buggy submission (verdict: Runtime Error):
 import sys
input=sys.stdin.readline

N,M=(int(x) for x in input().rstrip('\n').split())
Hs = [int(x) for x in input().rstrip('\n').split()]
nums = [1 for x in Hs]
for i in range(M):
  roads = [int(x) for x in input().rstrip('\n').split()]
  if Hs[roads[0]-1] < Hs[roads[1]-1]:
    nums[roads[0]-1] = 0
  elif Hs[roads[0]-1] > Hs[roads[1]-1]:
    nums[roads[1]-1] = 0
  else:
    nums[roads[0]-1] = 0
    nums[roads[1]-1] = 0
print(sum(nums))
Problem p02912 (python)

Fixed submission:
import sys
input=sys.stdin.readline

N,M = (int(x) for x in input().rstrip('\n').split())
As = [int(x) for x in input().rstrip('\n').split()]
As = sorted(As,reverse = True)
rest = M
for _ in range(M):
  if rest == 0:
    break
  d = As[0]
  b = d//2 - d//4
  for i in range(N):
    a = As[i]
    check = 0
    if a-a//2<b:
      if rest > i:
        ad = [x//2 for x in As[:i]]
        As = As[i:]
        As.extend(ad)
        rest -= i
        check += 1
        As = sorted(As,reverse = True)
        break
      else:
        ad = [x//2 for x in As[:rest]]
        As = As[rest:]
        As.extend(ad)
        check += 1
        rest = 0
        break
    if i == N-1:
      if check == 0:
        if rest > N:
          As = [x//2 for x in As]
          rest -= N
        else:
          ad = [x//2 for x in As[:rest]]
          As = As[rest:]
          As.extend(ad)
          rest = 0
          break
print(sum(As))

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline

N,M = (int(x) for x in input().rstrip('\n').split())
As = [int(x) for x in input().rstrip('\n').split()]
ad = {x:As.count(x) for x in set(As)}
rest = M
for _ in range(M):
  m = max(x for x,y in ad.items() if y>0)
  x = ad[m]
  if x < rest:
    if m//2 in ad:
      ad[m//2] += x
    else:
      ad[m//2] = x
    rest -= x
    ad[m] = 0
  else:
    ad[m] -= rest
    if m//2 in ad:
      ad[m//2] += rest
    else:
      ad[m//2] = rest
    break
  if all(x==0 for x in ad):
    break
print(sum(x*y for x,y in ad.items()))

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline

N,M = (int(x) for x in input().rstrip('\n').split())
As = [int(x) for x in input().rstrip('\n').split()]
ad = {x:As.count(x) for x in set(As)}
rest = M
for _ in range(M):
  m = max(ad.keys())
  x = ad[m]
  if x < rest:
    if m//2 in ad:
      ad[m//2] += x
    else:
      ad[m//2] = x
    del ad[m]
    rest -= x
  else:
    ad[m] -= rest
    if m//2 in ad:
      ad[m//2] += rest
    else:
      ad[m//2] = rest
    break
print(sum(x*y for x,y in ad.items()))
Problem p02571 (python)

Fixed submission:
s=input()
t=input()
s=list(s)
t=list(t)
d=[]
c=0
if len(s)==len(t):
    for j in range(len(t)):
        if s[j]!=t[j]:
            c+=1
    d.append(c)
else:
    for i in range(len(s)-len(t)):
        c=0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                c+=1
        d.append(c)
print(min(d))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s=list(s)
t=list(t)
d=[]
for i in range(len(s)-len(t)):
    c=0
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            c+=1
    d.append(c)
print(min(d))
Problem p02595 (python)

Fixed submission:
import sys
a = []
for l in sys.stdin:
    if l == "":
        break
    a.append(list(map(lambda x: int(x), l.split(" "))))

N = a[0][0]
D = a[0][1]
coo = a[1:]

import math

count = 0
for c in coo:
    l = math.sqrt(c[0]**2 + c[1]**2)
    if l <= D:
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import sys
a = []
for l in sys.stdin:
    a.append(map(lambda x: int(x), l.split(" ")))

N = a[0][0]
D = a[0][1]
coo = a[1:]

import math

count = 0
for c in coo:
    l = math.sqrt(c[0]**2 + c[1]**2)
    if l <= D:
        count += 1

print(count)
Problem p02550 (python)

Fixed submission:
n,x,m=map(int,input().split())
a=list()
ans=0
s=n
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
if s!=n:
    for i in range(s, len(a)):
        sum+=a[i]   

if len(a)>s:
    ans+=sum*(((n-s)//(len(a)-s))-1)

    z=(n-s)%(len(a)-s)
    if z!=0:
        for i in range(z):
            ans+=a[s+i]
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
a=list()
ans=0
s=n
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
if s!=n:
    for i in range(s, len(a)):
        sum+=a[i]

ans+=sum*(((n-s)//(len(a)-s))-1)

z=(n-s)%(len(a)-s)
for i in range(z):
    ans+=a[s+i]
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
a=list()
ans=0
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
for i in range(s, len(a)):
    sum+=a[i]

ans+=sum*(((n-s)//(len(a)-s))-1)

z=(n-s)%(len(a)-s)
for i in range(z):
    ans+=a[s+i]
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
a=list()
ans=0
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
for i in range(s, len(a)):
    sum+=a[i]

ans+=sum*(((n-s)//(len(a)-s))-1)

z=(n-s)%(len(a)-s)
for i in range(z):
    ans+=a[s]
    s+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
a=list()
ans=0
for i in range(n):
    ans+=x
    a.append(x)
    x=(x**2)%m
    if x in a:
        s=a.index(x)
        break

sum=0
for i in range(s, len(a)):
    sum+=a[i]

ans+=sum*(((n-s)//(len(a)-s))-1)

z=(n-s)%(len(a)-s)
for i in range(z):
    ans+=a[s]
    s+=1
print(ans)
Problem p02701 (python)

Fixed submission:
n = int(input())
i = 0
s = set()
while i<n:
    s.add(str(input()))
    i+=1


print(len(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
i = 0
s = list()
while i<n:
    a = str(input())
    k = 0
    j = 0
    while k<i:
        if s[k] == a:
            j = 1
            break
        k+=1
    if j == 0:
        s.append(a)
    i+=1

print(len(s))
Problem p02623 (python)

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

a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])
  
ans, j = 0, M
for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K-a[i]:
    j-= 1
  ans = max(ans, i+j)
print(ans)

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

ans = 0
remainTime = K

while remainTime >= 0:
  if not A and not B:
    ans += 1
    break
  elif A[0] > remainTime:
    ans += 1
    break
    elif B[0] > remainTime:
    ans += 1
    break
  elif not A:
    remainTime -= B.pop(0)
    ans += 1
  elif not B:
    remainTime -= A.pop(0)
    ans += 1
  else:
    if A[0] <= B[0]:
      remainTime -= A.pop(0)
      ans += 1
    else:
      remainTime -= B.pop(0)
      ans += 1
print(ans-1)
Problem p02835 (python)

Fixed submission:
As=list(map(int,input().split()))
if sum(As) >= 22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
As=list(input().split())
if As.sum() >= 22:
  print("bust")
else:
  print("win")
Problem p02570 (python)

Fixed submission:
dts = input().split()
if int(dts[1])*int(dts[2]) >= int(dts[0]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
dts = input().split()
if dts[1]*dts[2] >= dts[0]:
    print("Yes")
else:
    print("No")
Problem p02723 (python)

Fixed submission:
s = input()
if s[2]==s[3]:
    if s[4]==s[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if S[2]==S[3]:
    if S[4]==S[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[2]==s[3]:
    if s[4]==s[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Problem p03135 (python)

Fixed submission:
list = input().split()
print(float(list[0])/float(list[1]))

Buggy submission (verdict: Runtime Error):
list = input().split()

print(list[0]/list[1])

Buggy submission (verdict: Runtime Error):
T=input()
X=input()
print(T/X)

Buggy submission (verdict: Runtime Error):
t = T/X
print(t)
Problem p02629 (python)

Fixed submission:
N=int(input())
l=["a","b","c","d","e","f","g","h","i","j","k","l","m",
   "n","o","p","q","r","s","t","u","v","w","x","y","z"]
Ans=[]
s=0
for i in range(11):
    s+=26**i
    S=s+26**(i+1)
    if s<=N<S:
        I=i
        break
for i in range(I+1):
    N-=26**i
while I>=0:
    for i in range(0,26):
        n=N-26**I*i
        if n<26**I:
            Ans.append(l[i])
            N=n
            I-=1
            break
print("".join(Ans))

Buggy submission (verdict: Runtime Error):
N=int(input())
l=["a","b","c","d","e","f","g","h","i","j","k","l","m",
   "n","o","p","q","r","s","t","u","v","w","x","y","z"]
Ans=[]
s=0
for i in range(10):
    s+=26**i
    S=s+26**(i+1)
    if s<=N<S:
        I=i
        break
while I>=0:
    for i in range(1,27):
        n=N-26**I*i
        if n<26**I:
            Ans.append(l[i-1])
            N=n
            I-=1
            break
print("".join(Ans))
Problem p02753 (python)

Fixed submission:
S=input()
if S=="AAA" or S=="BBB":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<A*100/8+100/8:
        print(x)
        exit()
print("-1")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
for x in range(10*B,10*B+10):
    if A*100/8<=x<=A*100/8+100/8:
        print(x)
        exit()
print("-1")
Problem p02831 (python)

Fixed submission:
A,B=map(int,input().split())
if A>B:
    x,y=A,B
else:
    x,y=B,A
i=1
while x*i%y!=0:
    i+=1
print(x*i)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A>=B:
    x,y=A,B
else:
    x,y=B,A
i=1
while if x*i%y==0:
    i+=1
print(x*i)
Problem p02547 (python)

Fixed submission:
from sys import stdin
input = stdin.readline

N = int(input())

b = False
cnt = 0
for i in range(N):
    D1, D2 = map(int, input().split())
    if D1 == D2:
        cnt += 1
        if cnt == 3:
            b = True
    else:
        cnt = 0

if b == True:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
input = stdin.readline

N = int(input())

b = False
cnt = 0
for i in range(N):
    D1, D2 = map(int, input().split())
    if D1 == D2:
        cnt += 1
        if cnt == 3:
            b = True
    else:
        cnt = 0

if b == False:
    print('No')
else:
    print('Yes')
Problem p02571 (python)

Fixed submission:
s=input()
t=input()
ls=len(s)
lt=len(t)
a=[0]*(ls-lt+1)

for i in range(ls-lt+1):
    for j in range(lt):
        if s[i+j]!=t[j]:
            a[i]+=1

print(min(a))

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
ls=len(s)
lt=len(t)
a=[0]*(ls-lt)

for i in range(ls-lt):
    for j in range(lt):
        if s[i+j]!=t[j]:
            a[i]+=1

print(min(a))
Problem p02552 (python)

Fixed submission:
x = int(input())

print(int(x == 0))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
 
print(max(a * c, b * d, a * d, b * c))
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())

if 0 < a < 10 and 0 < b < 10:
    print(a * b)
else:
    print(-1)

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

for i in range(1, 10):
    if n % i == 0 and n / i < 10:
        print('Yes')
        break

else:
    print('No')
Problem p02897 (python)

Fixed submission:
from math import ceil

n = int(input())

if n % 2:
    print(ceil(n/2)/n)
else:
    print((n//2)/n)

Buggy submission (verdict: Runtime Error):
import math


def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
  

a, b = map(int, input().split())

gcd = gcd(a, b)

res = set([1])
while gcd % 2 == 0: 
        res.add(2)
        gcd = gcd // 2

for i in range(3,int(math.sqrt(gcd))+1,2): 
    while gcd % i == 0: 
        res.add(i)
        gcd = gcd // i 
            
if gcd > 2: 
    res.add(gcd)

print(len(res))
Problem p02987 (python)

Fixed submission:
from collections import Counter

s = input()

c = Counter(s)

if len(c) == 2:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return (factorial(n) // (factorial(n-r) * factorial(r)))

n, k = map(int, input().split())

for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))

Buggy submission (verdict: Runtime Error):
from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n-r) * factorial(r))

n, k = map(int, input().split())


for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))
Problem p02990 (python)

Fixed submission:
from math import factorial

def comb(n, r):
    if n < r:
        return 0
    return factorial(n) // (factorial(n-r) * factorial(r))

N, K = map(int, input().split())

for i in range(1, K+1):
    print(comb(N-K+1, i) * comb(K-1, i-1) % (10**9+7))

Buggy submission (verdict: Runtime Error):
from math import factorial

def comb(n, r):
    return (factorial(n) // (factorial(n-r) * factorial(r)))


n, k = map(int, input().split())


for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))

Buggy submission (verdict: Runtime Error):
from math import factorial

def comb(n, r):
    return factorial(n) // (factorial(n-r) * factorial(r))


n, k = map(int, input().split())


for i in range(1, k+1):
    print(comb(n-k+1, i) * comb(k-1, i-1) % (10**9+7))
Problem p03075 (python)

Fixed submission:
l = []
for _ in range(6):
    l.append(int(input()))

if l[-2] - l[0] > l[-1]:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
from itertools import product

x, y, z, k = map(int, input().split())

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

s = sum

delecious = []
for prod in product(a, b, c):
    delecious.append(s(prod))

delecious.sort(reverse=True)

for i in range(k):
    print(delecious[i])
Problem p02829 (python)

Fixed submission:
A=int(input())
B=int(input())
 
if A==1 and B==2:
  print("3")
if A==2 and B==3:
  print("1")
if A==1 and B==3:
  print("2")
if A==2 and B==1:
  print("3")
if A==3 and B==2:
  print("1")
if A==3 and B==1:
  print("2")

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A,B=1,2:
  print("3")
if A,B=2,3:
  print("1")
if A,B=1,3:
  print("2")
Problem p02847 (python)

Fixed submission:
S=input()
Day={"SUN":"7","MON":"6","TUE":"5","WED":"4","THU":"3","FRI":"2",
    "SAT":"1"}
print(Day[S])

Buggy submission (verdict: Runtime Error):
S=input()
Day={"SUN":"7","MON:"6","TUE":"5","WED":"4","THU":"3","FRI":"2",
    "SAT":"1"}
print(Day[S])
Problem p02860 (python)

Fixed submission:
n=int(input())
t=input()
T=list(t)

num=round(n/2)
 

if T[0:num]==T[num:n]:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
t=input()
T=list(t)

num=n/2

if T[0:num]==T[num:6]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input)
t=input()
T=list(t)

if T[0:3]==T[3:6]:
  print("Yes")
else:
  print("No")
Problem p02879 (python)

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

if A>=10 or B>=10:
 print("-1")
else:
 print(A*B)

Buggy submission (verdict: Runtime Error):
import sys

N=int(input())
for i in range(1,10):
  if N/i==N//i and N/i<10:
    print("Yes")
    sys.exit()
  else:
    print("No")
Problem p02880 (python)

Fixed submission:
import sys
 
N=int(input())
for i in range(1,10):
  if N/i==N//i  and N/i<10:
    print("Yes")
    sys.exit()
print("No")

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

a=[]
for i in range(1,10):
	if n/i<10:
      a.append("Yes")

if "Yes" in a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(1,10):
  if N/i==N//i and N/i<10:
    print("Yes")
    sys.exit()
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys

N=int(input())
for i in range(1,10):
  if n/i==n//i<10:
    print("Yes")
    sys.exit()
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
for i in range(1,10):
  if n/i==n//i<10:
    print("Yes")
  else:
    print("No")
Problem p02881 (python)

Fixed submission:
n=int(input())

d=[]
for h in range(1, int(n**0.5)+1):
	if n%h == 0:
		j=n//h
		d.append(j)
		i=n//j

print(i-1+j-1)

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

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

total=sorted(make_divisors(N))
print(total[1]-1+total[len(total)-2]-1)