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

Fixed submission:
N = int(input())
An = list(map(int,input().split()))
Bn = list(map(int,input().split()))
ans=0
for b in range(len(Bn)):
    left = min(An[b],Bn[b])
    ans+=left
    An[b]-=left
    Bn[b]-=left
    right = min(An[b+1],Bn[b])
    ans+=right
    An[b+1]-=right
    Bn[b]-=right
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
An = map(int,input().split())
Bn = map(int,input().split())
ans=0
for b in range(len(Bn)):
    left = min(An[b],Bn[b])
    ans+=left
    An[b]-=left
    Bn[b]-=left
    right = min(An[b+1],Bn[b])
    ans+=right
    An[b+1]-=right
    Bn[b]-=right
print(ans)
Problem p03307 (python)

Fixed submission:
import math
N = int(input())
if N%2==0:
    print(N)
else:
    print(N*2)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
print((N*2)//math.gcd(N,2))
Problem p03631 (python)

Fixed submission:
N = [i for i in input()]
check = True
if N[0] == N[-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = [i for i in input()]
check = True
for i in range(N):
    if N[i] != N[-i]:
       check = False
       break
if check ==True:
    print("Yes")
else:
    print("No")
Problem p03803 (python)

Fixed submission:
A,B = map(int,input().split())
if A == 1 or B == 1:
    if A==1 and B==1:
        print("Draw")
    elif A==1:
        print("Alice")
    else:
        print("Bob")
else:
    if A>B:
        print("Alice")
    elif B>A:
        print("Bob")
    else:
        print("Draw")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if 1 in A or 1 in B:
    if A==1 and B==1:
        print("Draw")
    elif A==1:
        print("Alice")
    else:
        print("Bob")
else:
    if A>B:
        print("Alice")
    elif B>A:
        print("Bob")
    else:
        print("Draw")
Problem p02699 (python)

Fixed submission:
a,b=map(int,input().split(" "))
if a>b:
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split(" ")
if a>b:
	print("safe")
else:
    print("unsafe")
Problem p02701 (python)

Fixed submission:
N = int(input())
s = set()
for _ in range(N):
    S = input()
    s.add(S)
print(len(s))

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
s = set()
for _ in range(N):
    S = raw_input()
    s.add(S)
print(len(s))
Problem p02707 (python)

Fixed submission:
N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (len(A) + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (A + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)
Problem p02707 (python)

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

List = [0] * (n)
for i in range(n-1):
    List[A[i]-1] += 1

for i in List:
    print(i)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[int(s) for s in input().split(" ")]

Max=max(A)


for i in range(1,Max+1):
    count=0
    if i==1:
        pos=A.pop(0)
    while pos==i:
        count+=1
        pos=A.pop(0)
        if A==[]:
            count+=1
            break
    print(count)

for i in range(N-Max):
    print(0)
Problem p02725 (python)

Fixed submission:
K,N=map(int,input().split())
A=[int(s) for s in input().split(" ")]

Smax=0
for i in range(N):
    S=0
    if i!=N-1:
        if A[i+1]>A[i]:
            S=A[i+1]-A[i]
        else:
            S=A[i]-A[i+1]
    else: 
        if A[0]>A[-1]:
            S=A[0]-A[-1]
        else:
            S=A[-1]-A[0]
    
    if S>K/2:
        S=K-S
    if Smax<S:
        Smax=S

print(K-Smax)

Buggy submission (verdict: Runtime Error):
K,N=map(int,input().split())
A=[int(s) for s in input().split(" ")]

Smax=0
for i in range(K):
    S=0
    if i==0:
        S=max(abs(A[0]-A[-1]),abs(A[0]-A[1]))
    elif i==K-1:
        S=max(abs(A[-1]-A[0]),abs(A[-1]-A[-2]))
    else:
        S=max(abs(A[i]-A[i+1]),abs(A[i]-A[i-1]))
    if Smax<S:
        Smax=S

print(K-Smax)
Problem p02754 (python)

Fixed submission:
N,A,B=[int(s) for s in input().split(" ")]
Ans1=N//(A+B)
Ans2=N%(A+B)
if Ans2>A:
    Ans3=A
else:
    Ans3=Ans2

Ans=A*Ans1+Ans3

print(int(Ans))

Buggy submission (verdict: Runtime Error):
A,B=[int(s) for s in input().split(" ")]
N1list=[]
N2list=[]

for i in range(0,10,1):
    N1list.append((A+(i/10))/0.08)   
    N2list.append((B+(i/10))/0.1)

N3=-2
N1list.sort(reverse=True)
N2list.sort(reverse=True)

if N1list[9]<N2list[0]:
    for i in range(10):
        N=N1list[i]
        if N==int(N):
            for j in range(10):
                if N==N2list[j]:
                    N3=N
                    break
        else:
            N4=-1
else:
    N4=-1
            
print(int(N3) if N4<N3 else N4)
Problem p02771 (python)

Fixed submission:
A,B,C=[int(s) for s in input().split()]
if A==B==C:
    print("No")
elif A!=B and B!=C and A!=C:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
A,B,C=[int(s) for s in input().split()]
if A==B=C:
    print("No")
elif A!=B!=C:
    print("No")
else:
    print("Yes")
Problem p02785 (python)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

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

#ListH.sort(reverse=True)
sum=0

if N<=K:
    print(0)
else:
     
for i in range(N-K):
    sum+=ListH[i]

print(sum)

Buggy submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH.sort(reverse=True)
sum=0

if N > K:
    for i in range(K):
        ListH.pop(i)
        
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Buggy submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)
sum=0

if N > K:
    for i in range(K):
        ListH.pop(i)

    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Buggy submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)

if N > K:
    for i in range(K):
        ListH.pop(i)

    sum=0
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Buggy submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)

if N > K:
    for i in range(K):
        ListH.pop(i)

    sum=0
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)
Problem p02860 (python)

Fixed submission:
N=int(input())
S=list(str(input()))

S_right=[]
S_left=[]
for i in range(0,(N//2)):
    S_left.append(S[i])
for i in range((N//2),N):
    S_right.append(S[i])
    
S_left=("").join(S_left)
S_right=("").join(S_right)

print("Yes" if S_left==S_right else "No")

Buggy submission (verdict: Runtime Error):
N=int()input()
S=input()
bit=0
for i in range(0,N):
  Check=S[0:i]
  Ans=S[i:N]
  if Check==Ans:
    bit+=1
print("Yes" if bit>=1 else "No")
Problem p02951 (python)

Fixed submission:
Water=input()
Water2=Water.split(" ")

A=int(Water2[0])
B=int(Water2[1])
C=int(Water2[2])

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)

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

A=int(A)
B=int(B)
C=int(C)

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)
Problem p02989 (python)

Fixed submission:
N=int(input())
D=[int(s) for s in input().split()]

D=sorted(D)
sum=[]
count=0
for i in reversed(range(len(D))):
    sum.append(D.pop(i))
    if len(sum) == len(D):
        Ans=len(sum)
        break
for i in range(D[Ans-1],sum[Ans-1],1):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
d=[int(s) for s in input().split(" ")]

d.sort()

if (N//2)%2==0:
    print(0)
else:
    K=d[(N//2)]-d[N//2-1]
    print(K
Problem p03042 (python)

Fixed submission:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if 0<Ans[0]<13 and 0<Ans[1]<13:
    print("AMBIGUOUS")
elif 0<Ans[0]<13:
    print("MMYY")
elif 0<Ans[1]<13:
    print("YYMM")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]


if Ans[0]>12:
    if Ans[1]>12:
        print("NA")
    elif Ans[1]==0:
        print("NA")
    else:
        print("YYMM")
elif Ans[0]==0:
    print("NA")
else:
    if A[1]>12:
        print("MMYY")
    elif A[1]==0:
        print("NA")
    else:
        print("AMBIGUOUS")
Problem p03207 (python)

Fixed submission:
N=int(input())
P=[int(input()) for _ in range(N)]
P=sorted(P)
P[N-1]=P[N-1]/2
print(int(sum(P)))

Buggy submission (verdict: Runtime Error):
N=int(input())
P=[int(input()) for _ in range(N)]
P=sorted(P)
P[N-1]=P[N-1]/2
print(int(sum(P))
Problem p02699 (python)

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
W:int
S:int

if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
if W >= S:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
if W > S:
  return "unsafe"
else:
  return "safe"

Buggy submission (verdict: Runtime Error):
if W >= S:
  return "unsafe"
else:
  return "safe"
Problem p02701 (python)

Fixed submission:
a = int(input())
s=[input() for i in range(a)]

print(len(set(s)))

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

print(len(set(s)))
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
takahashi_h, takahashi_a, aoki_h, aoki_a = map(int, input().split())

if takahashi_h // aoki_a < aoki_h // takahashi_a:
    print("Yes")
elif takahashi_h // aoki_a > aoki_h // takahashi_a:
    print("No")
else:
    takahashi_h = takahashi_h - (aoki_a * (takahashi_h // aoki_a))
    aoki_h = aoki_h - (takahashi_a * (aoki_h // takahashi_a))
    
    if aoki_h > 0 and takahashi_h == 0:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
takahashi_h, takahashi_a, aoki_h, aoki_a = map(int, input().split())

if takahashi_h // aoki_a > aoki_h // takahashi_a:
    print("Yes")
elif takahashi_h // aoki_a < aoki_h // takahashi_a:
    print("No")
else:
    takahashi_h = takahashi_h - (aoki_a * (takahashi_h // aoki_a))
    aoki_h = aoki_h - (takahashi_a * (aoki_h // takahashi_a))
    
    if aoki_h > 0 and takahashi_h == 0:
        print("No")
    else:
        print("Yes")
Problem p02707 (python)

Fixed submission:
# coding: utf-8
# Your code here!

N = int(input())
As = list(map(int, input().split()))
ans = [0 for _ in range(N)]
 
for a in As:
    ans[a-1] += 1

print(*ans, sep="\n")

Buggy submission (verdict: Runtime Error):
N = int(input())
As = list(map(int, input().split()))
ans = [0 for _ in range(N)]
 
for a in As
    ans[a-1] += 1

print(ans, sep="\n")
Problem p02723 (python)

Fixed submission:
word = input()

def Coffee(word):
  if word[2] == word[3] and word[4] == word[5]:
    print("Yes")
  else:
    print("No")
      
Coffee(word)

Buggy submission (verdict: Runtime Error):
X, Y, num_red_apple, num_green_apple, num_apple = map(int, input().strip().split())
red_apples = list(map(int, input().strip().split()))
green_apples = list(map(int, input().strip().split()))
apples = list(map(int, input().strip().split()))

good_apples = []
for i in range(1, X+1):
    good_apples.append(sorted(red_apples)[-i])

for i in range(1, Y+1):
    good_apples.append(sorted(green_apples)[-i])

while(1):
    if max(apples) > min(good_apples):
        good_apple = apples.pop(apples.index(max(apples)))
        good_apples.remove(min(good_apples))
        good_apples.append(good_apple)
    else:
        break
    
print(sum(good_apples))

Buggy submission (verdict: Runtime Error):
X, Y, num_red_apple, num_green_apple, num_apple = map(int, input().strip().split())
red_apples = list(map(int, input().strip().split()))
green_apples = list(map(int, input().strip().split()))
apples = list(map(int, input().strip().split()))

good_apples = []
for i in range(1, X+1):
    good_apples.append(sorted(red_apples)[-i])

for i in range(1, Y+1):
    good_apples.append(sorted(green_apples)[-i])

while(1):
    if max(apples) > min(good_apples):
        good_apple = apples.pop(apples.index(max(apples)))
        good_apples.remove(min(good_apples))
        good_apples.append(good_apple)
    else:
        break
    
print(good_apples)
Problem p02701 (python)

Fixed submission:
M = int(input())
P = [input() for i in range(M)]
print(len(set(P)))

Buggy submission (verdict: Runtime Error):
M = int(input())
P = [input().split() for i in range(M)]
print(len(set(P)))
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if(s>w):
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if c//b + 1 > a//d:
  print("No")
else:
  print("Yes")
Problem p02711 (python)

Fixed submission:
n = input()
if "7" in n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
from itertools import product
import numpy

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n = int(input())

l = product(range(1, 1+n), repeat=3)

print(numpy.cumsum([gcd(*i) for i in l])[-1])
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 = input()
n = s.__len__()
c = 0
l = list()
for i in range(n):
    l.append(s[i])
len = l.__len__()
for i2 in range(len):
    start = s[i2]
    for i3 in range(len-i2-1):
        start += s[i3+i2+1]
        if int(start) % 2019 == 0:
            c = c + 1
print(c)
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
if ( w >= s ):
    print("unsafe")
else:
    print("safe")

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

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if ( w >= s ):
	print("unsafe")
else:
	print("safe")

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if ( w >= s )
	print("unsafe")
else
	print("safe")

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if w > s
	print("unsafe")
else
	print("safe")

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
while (A>0 and C > 0):
    C = C - B
    if C <= 0:
        break
    A = A - D
print("Yes" if C<=0 else "No")
Problem p02771 (python)

Fixed submission:
A = map(int,input().split())
if len(set(A)) == 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
 A = map(int, input().split())
if len(set(A) ) == 2:
    print("Yes")
else:
    print("No")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
import numpy as np
length = len(S)
arr = np.array([int(S[i:j]) for i in range(0,length-3) for j in range(i+4, length+1)])
arr2 = arr % 2019
print(len(arr2)- np.count_nonzero(arr2))
Problem p02699 (python)

Fixed submission:
x,y = map(int,input().split())
if x<=y:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
t,k,a,o = map(int,input().split())
taka=int(a//k)
aoki=int(t//o)
if taka<=aoki:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
sheep_number=int(input())
wolf_number=int(input())
if sheep_number<=wolf_number:
    print('unsafe')
else:
    print('safe')

Buggy submission (verdict: Runtime Error):
sheep_number=S
wolf_number=W
if sheep_number<=wolf_number:
    print('unsafe')
else:
    print('safe')
Problem p02699 (python)

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

if (a > b):
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
a = int(input())
lst = []
for i in range(a):
    b = input()
    if not(b in lst):
    	lst.append(b)
        
print(len(lst))
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):
s = input()
if length(s) == 6:
  if s[2] == s[3]:
  	if s[4] == s[5]:
      print("Yes")
	else:
  	print("No")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)
count = 0
for i in range(0,n-3):
    s = S[i:i+4]
    for j in range(i+4,n):
        s = s + S[j]
        if int(s)%2019 == 0 : count += 1
print(count)
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=str(input())

ans=0
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        if int(s[i:j])%2019==0:
            ans+=1
print(ans)
Problem p02777 (python)

Fixed submission:
s,t=map(str,input().split())
a,b=map(int,input().split())
u=str(input())
if u==s:
    print(a-1, b)
else:
    print(a,b-1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
u=str(input())
if u==s:
    print(a-1, b)
else:
    print(a,b-1)
Problem p02793 (python)

Fixed submission:
import fractions
n=int(input())
t = list(map(int, input().split()))
x=0
ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // fractions.gcd(ans, t[i])
for j in range(n):
    x+=ans//t[j]
print(x%(10**9+7))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
t = list(map(int, input().split()))
l=[0 for i in range(n)]
ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // math.gcd(ans, t[i])
for j in range(n):
    l[j]=ans//t[j]
print(sum(l)%(10**9+7))
Problem p02862 (python)

Fixed submission:
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

x,y=map(int,input().split())
if (2*y-x)%3==0 and (2*x-y)%3==0 and  (2*y-x)/3>=0 and (2*x-y)/3>=0 :
    a=(2*y-x)//3
    b=(2*x-y)//3
    ans=cmb(a+b,a)
    print(ans%(10**9+7))
else:
    print('0')

Buggy submission (verdict: Runtime Error):
import math
x,y=map(int,input().split())
if (2*y-x)%3==0 and (2*x-y)%3==0:
    a=(2*y-x)/3
    b=(2*x-y)/3
    ans=math.factorial(a+b)//math.factorial(a)//math.factorial(b)
    print(ans%(10**9+7))
else:
    print('0')
Problem p02915 (python)

Fixed submission:
n=int(input())
print(n**3)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(n***3)
Problem p02699 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a,b = input().split()
if int(a) <= int(b):
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a,b = input().split()
if int(a) <= int(b):
  print("unsafe")
else:
  print("safe)
Problem p02699 (python)

Fixed submission:
s,w = map(int,input().split())

if s <= w :
    print('unsafe')

else :
    print('safe')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
i = 1
while a > 0 & c > 0:
    a = a
    c = c - i*b

    if c > 0:
        a = a-i*d
        c = c

        i += 1
if a <= 0:
    print('No')
if c  :
    print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())


n = c // b
m = c % b

if m != 0:

    if a - n * d <= 0 | a - (n-1) * d <= 0:
        print('No')

    else:
        print('Yes')


if m == 0:
    if a - (n-2) * d <= 0 | a - (n-1) * d <= 0:
        print('No')

    else:
        print('Yes')
Problem p02723 (python)

Fixed submission:
letters = input()
if letters[2] == letters[3] and letters[4] == letters[5] :
    print('Yes')

else :
    print('No')

Buggy submission (verdict: Runtime Error):
letters = input()
if letters[2] == letters[3] && letters[4] == letters[5] :
    print('Yes')

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

Fixed submission:
k,n = input().split()
k = int(k)
n = int(n)

l = list(map(int, input().split()))
m = [0]*n
count = 0

for i in range(n-1):
    m[count] = l[i+1] - l[i]
    count+=1
m[n-1] = k - l[n-1]+ l[0]

print(k - max(m))

Buggy submission (verdict: Runtime Error):
k,n = int(input().split())

l = list(map(int, input().split()))
m = [0]*n
count = 0

for i in range(n-1):
    m[count] = l[i+1] - l[i]
    count+=1
m[n-1] = k - l(n-1) + l[0]

print(k - max(m))
Problem p02729 (python)

Fixed submission:
n,m = map(int, input().split())

print(int(n * (n-1) / 2 + m * (m-1) / 2))

Buggy submission (verdict: Runtime Error):
L = int(input())
print((L/3)**3)

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

print(n * (n-1) / 2 + m * (m-1) / 2)
Problem p02753 (python)

Fixed submission:
S = input()
count = 0
for i in range(len(S)-1):
    if S[i] != S[i+1]:
      count+=1
    else:
      continue
if count>=1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
i = 0
for i in range(len(S))
    if S[i] != S[i+1]:
      print('Yes)
    else:
      print('No')
Problem p03042 (python)

Fixed submission:
S = int(input())
A = S//100
B = S-(A*100)
if B ==0 or B >= 13:
    if 1<= A <=12:    
        print("MMYY")
    else:
        print("NA")
elif 1<= B <=12:
    if 1<= A <=12:
        print("AMBIGUOUS")
    elif A >= 13:
        print("YYMM")
    elif A == 0:      
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Buggy submission (verdict: Runtime Error):
S = int(input())
A = S//100
B = S-(A*100)
if B >12:
    if  A > 13:    
        print("YYMM")
    else A <=12:
        print("MMYY")
elif 1<= B <=12:
    if A >13:
        print("YYMM")
    else A <=12:
        print("AMBIGUOUS")
else :
    print("NA")
Problem p03075 (python)

Fixed submission:
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
k = int(k)
if 0 <= a and b and c and d and e and k <=123 :
    if a < b < c < d < e:
        te = e - a
        if te <= k:    
            print("Yay!")
        else:
            print(":(")

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = int(e)
k = int(k)
if 0 <= a and b and c and d and e and k <=123 :
    if a < b < c < d < e:
        te = e - a
    if te <= k    
        print("Yay!")
    else:
        print(":(")
Problem p02699 (python)

Fixed submission:
s, w = input('').split()
s= int(s)
w=int(w)
if s > w:
	print('safe')
else:
	print('unsafe')

Buggy submission (verdict: Runtime Error):
a,b,c,d = input('').split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
while 1:
	c=c-b
	if c<=0:
		print('Yes')
		break
	a=a-d
	if a<=0:
		print('No')
		break

Buggy submission (verdict: Runtime Error):
a,b,c,d = input('').split()
a=int(a)
b=int(b)
c=int(c)
d=int(d)
while true:
	c=c-b
	if c<=0:
		print('Yes')
		break
	a=a-d
	if a<=0:
		print('No')
		break

Buggy submission (verdict: Runtime Error):
s, w = input(,)
if s >= w:
	print('safe')
else:
	print('unsafe')