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

Fixed submission:
n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))

Buggy submission (verdict: Runtime Error):
s=input()
aa=int(s[:2])
bb=int(s[3:])
if 0<aa<=12 and 0<bb<=12: ans='AMBIGUOUS'
elif 0<bb<=12: ans='YYMM'
elif 0<aa<=12: ans='MMYY'
else: ans='NA'
print(ans)
Problem p03042 (python)

Fixed submission:
s=input()
aa=int(s[:2])
bb=int(s[2:])
if 0<aa<=12 and 0<bb<=12: ans='AMBIGUOUS'
elif 0<bb<=12: ans='YYMM'
elif 0<aa<=12: ans='MMYY'
else: ans='NA'
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
aa=int(s[:2])
bb=int(s[3:])
if aa>12 and bb==0 or aa==0 and bb>12: ans='NA'
elif 0<aa<=12 and 0<bb<=12: ans='AMBIGUOUS'
elif aa>12 or aa==0 and 0<bb<=12: ans='YYMM'
else :ans='MMYY'
print(ans)1
Problem p03045 (python)

Fixed submission:
# 2019/10/10

class unionfind():
    def __init__(self,n):
        self.par=list(range(n+1))
        self.rank=[0]*(n+1)
        self.groups=n
    
    def find(self,x):
        if self.par[x]==x:
            return x
        else:
            self.par[x]=self.find(self.par[x])
            return self.par[x]
    
    def is_same(self,x,y):
        return self.find(x)==self.find(y)
    
    def unite(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if self.rank[x]<self.rank[y]:
            self.par[x]=y
        else:
            self.par[y]=x
            if self.rank[x]==self.rank[y]:
                self.rank[x]+=1
        if x!=y:self.groups-=1

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

uf=unionfind(n)

for i in range(m):
    x,y,z=map(int,input().split())
    uf.unite(x,y)
print(uf.groups)

Buggy submission (verdict: Runtime Error):
# 2019/10/10

class unionfind():
    def __init__(self,n):
        self.par=list(range(n+1))
        self.rank=[0]*(n+1)
    
    def find(self,x):
        if self.par[x]==x:
            return x
        else:
            self.par[x]=self.find(self.par[x])
            return self.par[x]
    
    def is_same(self,x,y):
        return self.find(x)==self.find(y)
    
    def unite(self,x,y):
        x=self.find(x)
        y=self.find(y)
        if self.rank[x]<self.rank[y]:
            self.par[x]=y
        else:
            self.par[y]=x
            if self.rank[x]==self.rank[y]:
                self.rank[x]+=1

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

uf=unionfind(n)

for i in range(m):
    x,y=map(int,input().split())
    uf.unite(x,y)
    uf.unite(y,x)

ans=set(uf.par[1:])
print(len(ans))
Problem p03135 (python)

Fixed submission:
t,x=map(float,input().split())
print(t/x)

Buggy submission (verdict: Runtime Error):
t,x=map(float,input())
print(t/3)
Problem p03207 (python)

Fixed submission:
n=int(input())
p=sorted([int(input()) for i in range(n)])
print(int(max(p)//2+sum(p[:-1])))

Buggy submission (verdict: Runtime Error):
n,*p,=map(int,open(0).read().split())
p=sorted(p)
print(p(max)//2)
Problem p03208 (python)

Fixed submission:
# 2019/07/25

input=open(0).readline

n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]

h.sort()
ans=float('inf')
for i in range(n-(k-1)):
    res=h[i+k-1]-h[i]
    ans=min(ans,res)

print(ans)

Buggy submission (verdict: Runtime Error):
# 2019/07/25

input=open(0).readline

n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]

h.sort()
ans=float('inf')
for i in range(n-2):
    res=h[i+k-1]-h[i]
    ans=min(ans,res)

print(ans)
Problem p03250 (python)

Fixed submission:
s=sorted(map(int,input().split()))
print(int(str(s[2])+str(s[1]))+s[0])

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print('No War' if max(max(x),X)<min(min(y),Y) else 'War')
Problem p03265 (python)

Fixed submission:
# 2019/08/06

x1,y1,x2,y2=map(int,input().split())

xx=x2-x1
yy=y2-y1

x3=x2-yy
y3=y2+xx
x4=x1-yy
y4=y1+xx
print(x3,y3,x4,y4)

Buggy submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,input().split())
x=x2-x1
y=y2-y1
x3=x2-y
y3=y2+x
x4=x1-y
y4=y1+x
print(f'{x3} {y3} {x4} {y4}')
Problem p03631 (python)

Fixed submission:
n=input()
print('Yes' if n==n[::-1] else 'No')

Buggy submission (verdict: Runtime Error):
# 2019/07/11

import sys
from heapq import heappop,heappush

input=sys.stdin.readline

n=int(input())
edge=[[] for _ in range(n)]
for _ in range(n-1):
    u,v,c=map(int,input().split())
    u-=1
    v-=1
    edge[u].append((c,v))
    edge[v].append((c,u))


def dijkstra(s):
    d=[float('inf')]*n
    visited=[False]*n
    d[s]=0
    visited[s]=True
    que=[]
    for e in edge[s]:
        heappush(que,e)
    while que:
        c,v=heappop(que)
        if visited[v]:continue
        d[v]=c
        visited[v]=True
        for cost,vtx in edge[v]:
            if visited[vtx]:continue
            hq=(cost+d[v],vtx)
            heappush(que,hq)

    return d

q,k=map(int,input().split())
k-=1

res=dijkstra(k)
for _ in range(q):
    x,y=map(int,input().split())
    x-=1
    y-=1
    print(res[x]+res[y])
Problem p03634 (python)

Fixed submission:
# 2019/07/11

from heapq import heappop,heappush

n=int(input())
edge=[[] for _ in range(n)]
for _ in range(n-1):
    u,v,c=map(int,input().split())
    u-=1
    v-=1
    edge[u].append((c,v))
    edge[v].append((c,u))


def dijkstra(s):
    d=[float('inf')]*n
    visited=[False]*n
    d[s]=0
    visited[s]=True
    que=[]
    for e in edge[s]:
        heappush(que,e)
    while que:
        c,v=heappop(que)
        if visited[v]:continue
        d[v]=c
        visited[v]=True
        for cost,vtx in edge[v]:
            if visited[vtx]:continue
            hq=(cost+d[v],vtx)
            heappush(que,hq)

    return d

q,k=map(int,input().split())
k-=1

res=dijkstra(k)
for _ in range(q):
    x,y=map(int,input().split())
    x-=1
    y-=1
    print(res[x]+res[y])

Buggy submission (verdict: Runtime Error):
# 2019/07/12
# DFS ver

import sys

input=sys.stdin.readline

n=int(input())
edge=[[] for _ in range(n)]
for _ in range(n-1):
    u,v,c=map(int,input().split())
    u-=1 ; v-=1
    edge[u].append((c,v))
    edge[v].append((c,u))

q,k=map(int,input().split())
k-=1

d=[0]*n
visited=[False]*n

def dfs(s,p):
    visited[s]=True
    for c,v in edge[s]:
        if visited[v] or p==v:continue
        d[v]=c+d[s]
        visited[v]=True
        dfs(v,s)
    return 


dfs(k,-1)
for _ in range(q):
    x,y=map(int,input().split())
    x-=1 ; y-=1
    print(d[x]+d[y])
Problem p03804 (python)

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

a=[input() for _ in range(n)]
b=[input() for _ in range(m)]
ans='No'
for i in range(n-m+1):
    for j in range(n-m+1):
        flag=True
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l]!=b[k][l]:flag=False
        if flag:
            ans='Yes'
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[input() for _ in range(n)]
b=[input() for _ in range(m)]
ans='No'
for i in range(n-m+1):
    for j in range(n-m+1):
        if a[i][j]==b[0][0] and a[i][j+1]==b[0][1] and a[i+1][j]==b[1][0] and a[i+1][j+1]==b[1][1]:
            ans='Yes'
            break
print(ans)
Problem p03013 (python)

Fixed submission:
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
for step in range(1,n+1):
    if step in a:
        dp[step] = 0
        continue
    if step == 1:
        if step in a:
            dp[1] = 0
        else:
            dp[1] = 1
        continue
    if step == 2:
        if step in a:
            dp[2] = dp[1]
        else:
            dp[2] = dp[1] + 1
        continue
    dp[step] = dp[step-1] + dp[step-2]
print(int(dp[n]%1000000007))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))

Buggy submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))

Buggy submission (verdict: Runtime Error):
n,m = [int(i) for i in input().split()]
a = {int(input()) for i in range(m)}
dp = {}
def stairs(step):
  if step in a:
    return 0
  if step == 1:
    return 1
  if step == 2:
    return stairs(step-1) + 1
  if step in dp.keys():
    return dp[step]
  else:
    dp[step] = stairs(step-1) + stairs(step-2)
    return dp[step]
print(int(stairs(n)%1000000007))
Problem p03774 (python)

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

s = []
for i in range(N):
    s.append(list(map(int, input().split())))

c = []
for j in range(M):
    c.append(list(map(int, input().split())))

for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)

Buggy submission (verdict: Runtime Error):
N,M = list(map(int, input().split()))
 
s = [list(map(int,input().split())) for i in range(n)]
c = [list(map(int,input().split())) for j in range(n)]
 
for t1 in s:
    l = list(map(lambda x: abs(t1[0] - x[0]) + abs(t1[1] - x[1]), c))
    print(l.index(min(l)) + 1)
Problem p03775 (python)

Fixed submission:
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = int(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N)) + 1) if N % r == 0]))
print(min(m) if len(m) != 0 else len(str(N)))

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

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = long(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N)))
Problem p02829 (python)

Fixed submission:
l=[1,2,3]
for i in range(2):
	l.remove(int(input()))
print(l[0])

Buggy submission (verdict: Runtime Error):
l=[1,2,3]
for i in range(2):
    l.remove(int(input))
print(l[0])
Problem p02831 (python)

Fixed submission:
a,b =list(map(int,input().split()))
def gcd(x,y):
	if max(x,y)%min(x,y)==0:return min(x,y)
	else:return  gcd(min(x,y),max(x,y)%min(x,y))
print(a*b//gcd(a,b))

Buggy submission (verdict: Runtime Error):
a,b =list(map(int,input().split()))
import math
print(a*b//math.gcd(a,b))
Problem p02891 (python)

Fixed submission:
s=input()
k=int(input())
if len(s)==1:
	print(k//2)
	exit()
cnt=0
same_length=1
first=1
for i in range(len(s)-1):
 		 if s[i]==s[i+1]:
 		 	same_length+=1
 		 	if cnt==0:first+=1
 		 elif s[i]!=s[i+1]:
 		 	if cnt==0:s_left=first
 		 	cnt+=int(same_length//2)
 		 	same_length=1
if same_length==len(s):
	print(len(s)*k//2)
	exit()
s_right=same_length
cnt+=int(same_length//2)
if s[0]==s[-1] and s_left%2==1 and s_right%2==1:
	print(cnt*k+k-1)
else:
	print(cnt*k)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
cnt=0
same_length=1
for i in range(len(s)-1):
	if s[i]==s[i+1]:
		same_length +=1
	else:
		cnt+=int(same_length//2)
		same_length=1
cnt+=int(same_length//2)
if s[0]==s[-1] and s[-1]!=s[-2] and s[0]!=s[1]:
	cnt+=1
print(cnt*k)
Problem p02912 (python)

Fixed submission:
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
heapify(a)
for i in range(m):
	num=heappop(a)*-1
	heappush(a,(num//2)*-1)
print(sum(a)*-1)

Buggy submission (verdict: Runtime Error):
from heapq import heapify,heappop,heappush
n,m=map(int,input().split())#n:num m:ticket
a=[-int(_) for _ in input().split()]
a=heapify(a)
for i in range(m):
	heappush(a,heappop//2)
print(sum(a)*-1)

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m=map(int,input().split())#n:num m:ticket
a=[int(_) for _ in input().split()]
a=deque(a)
for i in range(m):
	a[a.index(max(a))]=max(a)//2
print(sum(a))
Problem p02915 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input())**３)
Problem p02777 (python)

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

Buggy submission (verdict: Runtime Error):
def main():
	n=int(input())
	a=list(map(int, input().split()))
	count = 0
	while count==0:
		for i in range(n):
			if  a.count(a[i])> 1:
				count+=1
				print('NO')
				break
			else:
				continue
	if count==0:
		print('YES')
main()
Problem p02790 (python)

Fixed submission:
#AtCorder
def main():
	a,b=map(int, input().split())
	if a <=b:
		print(str(a)*b)
	else:
		print(str(b)*a)
main()

Buggy submission (verdict: Runtime Error):
#AtCorder
def main():
	a,b=map(int, input().split())
	for i in range(a)
	if a*10**b <=b*10**a:
		print(str(a)*b)
	else:
		print(str(b)*a)
main()
Problem p02771 (python)

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

if a == b and a!=c:
    print("Yes")
elif a == c and a!=b:
    print("Yes")
elif b == c and b != a:
    print("Yes")  
else:
    print("No")

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

if a == b and a!=c:
    print("Yes")
elif a == c and a!=b:
    print("Yes")
elif b == c and b != a:
    print("Yes")  
else:
    print("No")

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

if a == b and a!=c:
    print("Yes")
elif a == c and a!=b:
    print("Yes")
elif b == c and b != a:
    print("Yes")  
else:
    print("No")
Problem p02777 (python)

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

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

Fixed submission:
a,b = input().split()
a,b = int(a), int(b)
x = max(a,b)
y = min(a,b)
t = 0
if x % y == 0:
    t = y
else:
    while x % y != 0:
        z = x%y
        x = y
        y = z
    t = z

glm = a * b /t
print(round(glm))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
 
c,d = [int(i) for i in readline().split()]
 
print(c*d//gcd(c,d))

Buggy submission (verdict: Runtime Error):
import math
a,b = input().split()
a,b = int(a), int(b)
gcd = int(math.gcd(a,b))
glm = a * b /gcd
print(round(glm))
Problem p02829 (python)

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

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

if A == 1 and B ==2:
  return 3
elif A == 1 and B ==3:
  return 2
elif A == 2 and B ==1:
  return 3
elif A == 2 and B ==3:
  return 1
elif A == 3 and B ==1:
  return 2
else:
  return 1
Problem p02897 (python)

Fixed submission:
r = None
N = int(input())
if (N % 2)==0:
  r = 1/2
else:
  r = (N+1) / (N*2)
print(r)

Buggy submission (verdict: Runtime Error):
r = None
N = int(input())
if (N % 2)=0:
  r = 1/2
else:
  r = (N+1) / (N*2)
print(r)
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s=list(input())
t=s.pop(k-1)
s.insert(k-1,t.lower())
print("".join(s))

Buggy submission (verdict: Runtime Error):
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=list(input())
t=s.pop(k-1)
s.insert(k-1,t.lower())
print("".join(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
t=s.pop(k-1)
s.insert(k-1,t.lower())
print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split)
s=input()
t=s.pop(k-1)
s.insert(k-1,t.lower())
print(s)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input())
s=input()
t=s.pop(k-1)
s.insert(k-1,t.lower())
print(s)
Problem p03042 (python)

Fixed submission:
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
    if(0<a//100<13):
      print("MMYY")
    else:
      print("NA")

Buggy submission (verdict: Runtime Error):
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
  else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")
Problem p03073 (python)

Fixed submission:
s=input()
count=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))

Buggy submission (verdict: Runtime Error):
s=input()
count1=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))
Problem p03075 (python)

Fixed submission:
a=sorted([int(input()) for _ in range(5)])
print("Yay!" if a[4]-a[0]<=int(input()) else ":(")

Buggy submission (verdict: Runtime Error):
print((int(input())+1)//sorted([input() for _ in range(5)])+5)

Buggy submission (verdict: Runtime Error):
a=sorted([int(input()) for _ in range(5)])
ls=sorted([a[i+1]-a[i] for i in range(4)])
print("Yay!" if ls[4]<input() else ":(")
Problem p02933 (python)

Fixed submission:
a = int(input())

s = input()

if a >= 3200:
    print("{}".format(s))
else:
    print("red")

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

a = input().split()

sum_a_rev = 0

for i in range(n):
    sum_a_rev = sum_a_rev + 1/int(a[i])

res = 1/sum_a_rev

print("{}".format(res))
Problem p02771 (python)

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

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    S = sorted([input() for s in range(n)])
    D = list(set(S))
    count = []*len(D)
    for i in range(len(D)):
        count[i] = S.count(D[i])
    maxi = max(count)
    for i in range(len(D)):
        if(count[i]==maxi):
            print(D[i])
main()
Problem p02766 (python)

Fixed submission:
n,sin=map(int,input().split(' '))
ls=[]
while n>=sin:
    ls.append(n%sin)
    n=n//sin
ls.append(n)

print(len(ls))

Buggy submission (verdict: Runtime Error):
n,sin=map(int,input().split(' '))
while n>=sin:
    ls.append(n%sin)
    n=n//sin
ls.append(n)
print(len(ls))
Problem p02785 (python)

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

h.sort(reverse=True)

if len(h)<=k:
  print(0)
  
else:
  del h[0:k]
  print(sum(h))

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

h.sort(reverse=True)

if len(h)<=k:
  print(0)
  
else:
  for i in range(k):
    h.remove(h[i])
  print(sum(h))
Problem p02771 (python)

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

if (array[0] == array[1]) & (array[1] == array[2]) & (array[2] == array[0]):
    print('No')

elif (array[0] != array[1]) & (array[1] != array[2]) & (array[2] != array[0]):
    print('No')

else:
    print('Yes')

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

array = (list(map(int, input().split())))

product_array = []

for i in range(n):
    for j in range(n - (i + 1)):
        product_array.append(array[i] * array[i + j + 1])

product_array.sort()

print(product_array[k - 1])
Problem p02836 (python)

Fixed submission:
S = input()
Slist = []
for i in range(len(S)):
    Slist.append(S[i]) 

count = 0
##print(len(S))

for i in range(len(S)//2):
    ##print(Slist[i],Slist[-i-1])
    if Slist[i] != Slist[len(S)-1-i]:
        count +=1
    
    

print(count)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
sum = a + b + c
if sum >= 22:
    print('bust')
else:
    print('win')
Problem p02777 (python)

Fixed submission:
items=input().split()
nums=list(map(int, input().split()))
target=input()
if(target==items[0]):
    print(nums[0]-1,nums[1])
else:
    print(nums[0],nums[1]-1)

Buggy submission (verdict: Runtime Error):
num=list(map(int,input().split()))
nums=list(map(int, input().split()))
a=[0]*num[1]
max=-1
for i in nums:
    a.append((i+1)/2)
    a.pop(0)
    s=sum(a)
    if(s>max):
        max=s
print(max)
Problem p02759 (python)

Fixed submission:
n=int(input())
sei=int(n/2)
tmp=n%2
if tmp==0:
    sei=sei
else:
    sei=sei+1
print(sei)

Buggy submission (verdict: Runtime Error):
n=input()
sei=n/2
tmp=n%2
if tmp==0:
    
else:
    sei=sei+1
print(sei)
Problem p02793 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#a, b = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
mod = (10 ** 9) + 7


def lcm(a):
  from fractions import gcd
  x = a[0]
  for i in range(1, len(a)):
      x = (x * a[i]) // gcd(x, a[i])
  return x

p = lcm(A)
#print (p)

sum = 0
for i in range(N) :
  sum += p//A[i]

print (int(sum%mod))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#a, b = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
#mod = (10 ** 9) + 7
mod = 1000000007

def lcm(a):
  from fractions import gcd
  x = a[0]
  for i in range(1, len(a)):
      x = (x * a[i]) // gcd(x, a[i])
  return x

p = lcm(A)
#print (p)

sum = 0
for i in range(N) :
  sum += p/A[i]

print (int(sum%mod))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#a, b = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
mod = (10 ** 9) + 7

def lcm(a):
  from fractions import gcd
  x = a[0]
  for i in range(1, len(a)):
      x = (x * a[i]) // gcd(x, a[i])
  return x

p = lcm(A)

sum = 0
for i in range(N) :
  sum += p/A[i]

print (int(sum%mod))
Problem p02833 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import math
import datetime
import itertools
import sys
import copy

# 入力
#N = int(input())
#S = str(input())
#N, A, B = map(int, input().split())
N = int(input())

if N%2 == 1 :
  print (0)
  exit()
else :
  cnt = 0
  i = 1
  N //= 2
  while N >= 5**i :
    cnt += N // (5**i)
    i += 1
    
  print (cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math
import datetime
import itertools
import sys
import copy

# 入力
#N = int(input())
#S = str(input())
#N, A, B = map(int, input().split())
N = int(input())

if N%2 == 1 :
  print (0)
else :
  cnt = 0
  i = 1
  N //= 2
  while N >= 5**i :
    cnt += N // (5**i)
    i += 1
    
print (cnt)
Problem p02753 (python)

Fixed submission:
value = input()

if value == "AAA" or value == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
value = input()
if value == "AAA" or "BBB":
  print("No")
 else:
  print("Yes")
Problem p02771 (python)

Fixed submission:
input_line = input().split(' ')
 
arr = set(input_line)
if(len(arr) == 2):
  print('Yes')
else:
  print('No')

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

arr = set(input_line)
if(len(arr) === 2):
  print('Yes')
else:
  print('No')
Problem p02915 (python)

Fixed submission:
num = int(input())
 
if num == 1:
  print(1)
else:
  print(num**3)

Buggy submission (verdict: Runtime Error):
num = int(input())
 
if num = 1:
  print(1)
else:
  print(num*num*num)

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

if num = 1:
  print(1)
else:
  print(num**3)