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

Fixed submission:
nN = int(input())
 
nList = []
 
nTmp = int(input())
nList.append(nTmp)
nAns = 1
 
if (nN > 1):  
  for i in range(nN - 1):
    nTmp = int(input())
      
    if nTmp not in nList:
      nList.append(nTmp)
      nAns += 1
    
print(nAns)

Buggy submission (verdict: Runtime Error):

nN = int(input())


nList = []

nTmp = int(input())
nList.append(nTmp)
nAns = 1

if (nN > 1):
  nTmp = int(input())
  if nTmp in nList:
    continue
  else:
    nList.append(nTmp)
    nAns += 1
  





print(nAns)
Problem p03644 (python)

Fixed submission:
import sys
 
N=int(input())
 
if N==1:
  print(1)
  sys.exit()

Flag=0
nCnt=1
Tmp=2
while Flag==0:
  TmpN = N /Tmp
  if TmpN >= 2:
    Tmp *= 2
    nCnt +=1
  else:
    Flag=1

A = 2 ** (nCnt)
print(A)

Buggy submission (verdict: Runtime Error):
import sys

N=int(input())

if N==1:
  print(1)
  sys.exit()

Flag=0
nCnt=1
Tmp=2
while Flag=0:
  TmpN = N /Tmp
  if TMpN >= 2:
    Tmp *= 2
    nCnt +=1
  else:
    Flag=1

A = 2 ** (nCnt)
print(A)
Problem p03711 (python)

Fixed submission:
import sys
 
X, Y=map(int,input().split())
 
if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 or Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

X, Y=map(int,input().split())

if X==2 or Y==2:
  print('No')
  sys.exit()
elif X==4 or X==6 or X==9 or X==11:
  if Y==6 or Y==9 or Y==11:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
else:
  if Y==3 or Y==5 or Y==7 or Y==8 or Y==10 Y==12:
    print('Yes')
    sys.exit()
  else:
    print('No')
    sys.exit()
Problem p03777 (python)

Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
sA = (Tmp[0])
sB = (Tmp[1])
 
if sA == 'H' and sB == 'H':
  print('H')
elif sA == 'H' and sB == 'D':
  print('D')
elif sA == 'D' and sB == 'D':
  print('H')
elif sA == 'D' and sB == 'H':
  print('D')

Buggy submission (verdict: Runtime Error):
Tmp = []
Tmp = input().rstrip().split(',')
 
sA = (Tmp[0])
sB = (Tmp[1])

if sA == 'H' and sB == 'H':
  print('H')
elif sA == 'H' and sB == 'D':
  print('D')
elif sA == 'D' and sB == 'D':
  print('H')
elif sA == 'D' and sB == 'H':
  print('D')
Problem p03860 (python)

Fixed submission:
Tmp = []
Tmp = input().rstrip().split(' ')
 
S = []
S = (Tmp[1])
 
sTmp = S[0]
 
print('A', end='')
print('%s' %(sTmp), end='')
print('C')

Buggy submission (verdict: Runtime Error):

Tmp = []
Tmp = input().rstrip().split(' ')

S = []
S = int(Tmp[1])

sTmp = S[0]

print('A'+sTmp+'C')
Problem p04011 (python)

Fixed submission:
import sys
 
nN = int(input())
nK = int(input())
nX = int(input())
nY = int(input())
 
nE = 0
nAns = 0
 
if nN <= nK:
  nAns = nX * nN
  print(nAns)
  sys.exit()
  
nE = nN - nK
 
nAns = (nX * nK) + (nY * nE)
print(nAns)

Buggy submission (verdict: Runtime Error):
import sys
 
nN = int(input())
nK = int(input())
nX = int(input())
nY = int(input())
 
nE = 0
nANs = 0
 
if nN =< nK:
  nAns = nX * nN
  print(nAns)
  sys.exit()
  
nE = nN - nK
 
nAns = nX * nN + nY * nE
print(nAns)

Buggy submission (verdict: Runtime Error):
import sys

nN = int(input())
nK = int(input())
nX = int(input())
nY = int(input())

nE = 0

if nN =< nK:
  nAns = nX * nN
  print(nAns)
  sys.exit()
  
nE = nN - nK

nAns = nX * nN + nY * nE
print(nAns)
Problem p02927 (python)

Fixed submission:
M,D=map(int,input().split(" "))
cnt=0
for m in range(M):
    for d in range(D):
        m1=m+1
        d1=d+1
        if len(str(d1))==1:
            continue
        if int(str(d1)[0])>=2 and int(str(d1)[1])>=2 and int(str(d1)[0])*int(str(d1)[1])==m1:

            cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split(" "))
A=list(map(int,input().split(" ")))
#N=3
#K=3
#A=[1,3,2]
A1=[set() for _ in range(N)]
cnt=0
cnt1=0
for n1 in range(N):
    for n2 in range(N):
        if n1!=n2 and A[n1]>A[n2]:
            cnt+=1
        if n1<n2 and A[n1]>A[n2]:
            cnt1+=1

#ten=int(cnt1+cnt*(K**2-K)/2+cnt1*(K-1))
k2=(K**2)%(10**9+7)
ten1=int((k2*cnt)%(10**9+7))
ten2=int((K*cnt)%(10**9+7))
ten3=int((cnt1*K)%(10**9+7))
if ten1-ten2<0:
    ten=((ten1-ten2+10**9+7)/2)%(10**9+7)
else:
    ten=((ten1-ten2))/2%(10**9+7)
ten=ten+ten3
print(int(ten%(10**9+7)))
Problem p02909 (python)

Fixed submission:
s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
elif s == 'Rainy':
    print('Sunny')

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

if s = 'Sunny':
    print('Cloudy')
elif s = 'Cloudy':
    print('Rainy')
else s = 'Rainy':
    print('Sunny')
Problem p02921 (python)

Fixed submission:
s = input()
t = input()

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=1
print(ans)

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

ans = 0
for i in range(3):
    if s[i]==t[i]:
        ans+=1
    i+=
print(ans)
Problem p02934 (python)

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

g = 0

# for 文書きたくねぇ
for a in aa:
    g += 1 / a

print(1 / g)

Buggy submission (verdict: Runtime Error):
n = int(input())
aa = list(map(int, input().strip().sprit()))

g = 0

# for 文書きたくねぇ
for a in aa:
    g += 1 / a

print(1 / g)

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

g = 0

# for 文書きたくねぇ
for x in a:
    g += 1 / x

print(1 / g)
Problem p02957 (python)

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

# 演算子%は余りを出す　//は小数切り捨てて整数値を出す
if (a + b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')

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

# 演算子%は余りを出す　//は小数切り捨てて整数値を出す
if (a + b) % 2 == 0:
    print((a+b)//2)
else:
    print('IMPOSSIBLE')
Problem p02981 (python)

Fixed submission:


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

print(min(b,a*n))

Buggy submission (verdict: Runtime Error):


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

print(min(b,a*n))
Problem p04043 (python)

Fixed submission:
a, b, c = map(int, input().split())
 
if a == 5 and b == 5 and c == 7:
  print("YES")
elif a == 5 and b == 7 and c == 5:
  print("YES")  
elif a == 7 and b == 5 and c == 5:
  print("YES") 
else:
  print("NO")

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

if a == 5 and b == 5 and c == 7:
  print("YES")
elif a == 5 and b == 7 and c == 5:
  print("YES")  
elif a == 7 and b == 5 and c == 5:
  print("YES") 
else
  print("NO")
Problem p02945 (python)

Fixed submission:
a,b = map(int,input().split())
cmax = max((a+b),(a*b),(a-b))
print(cmax)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()

cmax = max((a+b),(a-b),(a*b))
print(cmax)

Buggy submission (verdict: Runtime Error):
max((a+b),(a-b),(a*b))
Problem p02958 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
count=0
for i,j in enumerate(b,1):
  if i != j:
    count +=1

if count <= 2:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
count=0
for i,j in enumerte(a,1):
  if i != j:
    count +=1

if count <= 2:
    print('YES')
else:
    print('NO')
Problem p02982 (python)

Fixed submission:
n,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=0
for i in range(n):
  for j in range(i+1,n):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=1
for i in range(i,a):
  for j in range(i+1,a):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)
Problem p03006 (python)

Fixed submission:
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}

if N==1:
    print(1)
    exit()
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy submission (verdict: Runtime Error):
# Picking Up
# グラフ,有向グラフ,ベクトル, ２次元、コスト,

N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append([x, y])
cost = N
d = {}
for l,le in enumerate(S):
    for m, me in enumerate(S):
        if l == m:
            continue
        t = (me[0] - le[0], me[1] - le[1])
        if t in d:
            d[t] +=1
        else:
            d[t] = 1

print(N - max(d.values()))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append(x + y)
S.sort()
cost = N
target = 1
# 同じではなくて割り切れるやつを探す
for a in S:
    temp_cost = 1
    bb = -1
    for b in S:
        if bb != b and b % a != 0:
            # print("a:{0}, b:{1}".format(a, b))
            temp_cost += 1
        bb = b
    temp_cost += S.count(a) - 1
    if temp_cost < cost:
        cost = temp_cost
print(cost)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = []
for _ in range(N):
    x, y = map(int, input().split())
    S.append(x + y)
S.sort()
cost = N
target = 1
# 同じではなくて割り切れるやつを探す
for a in S:
    temp_cost = 1
    bb = -1
    for b in S:
        if bb != b and b % a != 0:
            # print("a:{0}, b:{1}".format(a, b))
            temp_cost += 1
        bb = b
    temp_cost += S.count(a) - 1
    if temp_cost < cost:
        print(temp_cost)
        cost = temp_cost
print(cost)
Problem p02899 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
list=[]
for num in range(n):
    i=int(input())
    list.append(i)
for num in range(n):
    print(list.index(num+1)+1,end=" ")

Buggy submission (verdict: Runtime Error):
n=int(input())
list=[]
for num in range(n):
    i=int(input())
    list.append(i)
for num in range(n):
    print(list.index(num+1)+1)
Problem p03565 (python)

Fixed submission:
if __name__ == '__main__':
    hidden_key = input()
    flag_string = input()

    key_length = len(hidden_key)
    flag_length = len(flag_string)

    if key_length < flag_length:
        print('UNRESTORABLE')
        exit()

    key_list = list(hidden_key.replace('?', 'a'))

    for i in reversed(range(key_length - flag_length + 1)):
        part_key = hidden_key[i:i + flag_length]
        is_match = True

        for j in range(flag_length):
            if part_key[j] != '?' and part_key[j] != flag_string[j]:
                is_match = False
                break
            
        if is_match:
            for k in range(flag_length):
                key_list[i + k] = flag_string[k]
            print(''.join(key_list))
            break

    if not is_match:
        print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    hidden_key = input()
    flag_string = input()

    key_length = len(hidden_key)
    flag_length = len(flag_string)

    key_list = list(hidden_key.replace('?', 'a'))

    for i in reversed(range(key_length - flag_length + 1)):
        part_key = hidden_key[i:i + flag_length]
        is_match = True

        for j in range(flag_length):
            if part_key[j] != '?' and part_key[j] != flag_string[j]:
                is_match = False
                break
            
        if is_match:
            for k in range(flag_length):
                key_list[i + k] = flag_string[k]
            print(''.join(key_list))
            break

    if not is_match:
        print('UNRESTORABLE')
Problem p03796 (python)

Fixed submission:
mod = 1000000007

n = int(input())
factorial_previous = 1

for i in range(1,n+1):
    factorial = (i*factorial_previous)%mod
    factorial_previous = factorial
print(factorial)

Buggy submission (verdict: Runtime Error):
mod = 1000000007

n = int(input())
factorial_previous = 1

for i in range(2,n+1):
    factorial = (i*factorial_previous)%mod
    factorial_previous = factorial
print(factorial)
Problem p04001 (python)

Fixed submission:
s = input()
n = len(s)
answer = 0


for i in range(2**(n-1)):
    calc_str = s[0]
    operator_maker = str(format(i, 'b')).zfill(n-1)
    for j, c in enumerate(operator_maker):
        if c == '1':
            calc_str += '+'
        if n != 1:
            calc_str += s[j+1]
    answer += eval(calc_str)

print(answer)

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
answer = 0


for i in range(2**(n-1)):
    calc_str = s[0]
    operator_maker = str(format(i, 'b')).zfill(n-1)
    for j, c in enumerate(operator_maker):
        if c == '1':
            calc_str += '+'
        calc_str += s[j+1]
    answer += eval(calc_str)

print(answer)
Problem p03037 (python)

Fixed submission:

n,m = map(int,input().split())
L = []
R = []
for i in range(m):
	l,r = map(int,input().split())
	L.append(l)
	R.append(r)

l = L[0]
r = R[0]
cnt = 0
for i in range(max(L),min(R)+1) :
	if 0<=i<=r :
		cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
res={i for i in range(1,n+1)}
for i in range(m):
	l,r = map(int,input().split())
	g = { i for i in range(min(res) if l < min(res) else l,r+1)}
	res = res&g
	if res == {} :
		print(0)
		break
print(len(res))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
r={i for i in range(1,n+1)}
for i in range(m):
	l,r = map(int,input().split())
	g = { i for i in range(l,r+1)}
	r = r&g
	if r == {} :
		print(0)
		break
print(len(r))
Problem p03086 (python)

Fixed submission:
S = list(input())
n = []
a = 0
for i,s in enumerate(S) :
	if s in ["A","T","G","C"] :
		a += 1
	else :
		n.append(a)
		a = 0
	
	if i+1 == len(S) :
		n.append(a)
		break
print(max(n))

Buggy submission (verdict: Runtime Error):
S = list(input())
n = []
a = 0
for s in S :
	if s in ["A","T","G","C"] :
		a += 1
	else :
		n.append(a if a > 0 else 0)
		a = 0
print(max(n))
Problem p03109 (python)

Fixed submission:
y,m,d = input().split("/")
flag = False
if(int(y) > 2019) :
  flag = True
elif(int(y) == 2019):
  if(int(m)>=5):
    flag = True
print("TBD" if flag else "Heisei")

Buggy submission (verdict: Runtime Error):
y,m,d = input().split("/")
flag = False
if(int(y) > 2019) :
  flag = True
elif(int(y) == 2019):
  if(m>=5):
    flag = True
print("TBD" if flag else "Heisei")
Problem p03125 (python)

Fixed submission:
a,b = map(int,input().split(" "))
if (b%a == 0):
  print(a+b)
else :
  print(b-a)

Buggy submission (verdict: Runtime Error):
a,b = int(input().split(" "))
if (b%a == 0):
  print(a-b)
else :
  print(b-a)
Problem p03145 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input.split(" "))
print((a*b)/c)
Problem p03219 (python)

Fixed submission:
#coding : UTF-8
x,y = map(int,input().split())
print(int(x+y/2))

Buggy submission (verdict: Runtime Error):
#coding : UTF-8
x,y = input.split()
print(int(x)+int(y/2))
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split(" "))
print(":("if a>8 or b>8 else "Yay!")

Buggy submission (verdict: Runtime Error):
a,b=int(input())
print(":("if a>8 or b>8 else "Yay!")
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split(" "))
print(max([a+b,a-b,a*b]))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split(" "))
print(max([a+b,a-b,a*b])
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split(" "))
print("Even" if (a*b)%2==0 else "Odd")

Buggy submission (verdict: Runtime Error):
a,b = int(input().split(" "))
print("Even" (a*b)%2==0 else "Odd")
Problem p03469 (python)

Fixed submission:
y,m,d = input().split("/")
print("2018/"+m+"/"+d if y == "2017" else y+"/"+m+"/"+d)

Buggy submission (verdict: Runtime Error):
y,m,d = input().split("/")
print("2018/"+m"/"+d if y == "2017" else y+"/"+m"/"+d)
Problem p03543 (python)

Fixed submission:
s = input()
flag = False
for n in s :
	m = s.find(n)
	if m < len(s)-2 and s[m] == s[m+1] == s[m+2] :
		flag = True
		break
print("Yes" if flag else "No")

Buggy submission (verdict: Runtime Error):
s = input()
flag = False
for n in s :
	m = s.find(n)
	if s[m] == s[m+1] == s[m+2] :
		flag = True
		break
print("Yes" if flag else "No")
Problem p03547 (python)

Fixed submission:
a,b = input().split()
print("<" if a<b else ">" if a>b else "=")

Buggy submission (verdict: Runtime Error):
a,b = input().split()
print("<" a<b else ">")
Problem p03636 (python)

Fixed submission:
a,*b,c=input()
print(a+str(len(b))+c)

Buggy submission (verdict: Runtime Error):
a,*b,c=list(input().split())
print(a+str(len(b))+c)
Problem p03671 (python)

Fixed submission:
s = list(map(int,input().split()))
m = min(s)
s.remove(m)
print(m+min(s))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
m = min(a,b,c)
n = min([a,b,c].remove(m))
print(m+n)
Problem p03997 (python)

Fixed submission:
n = [int(input()) for _ in [0]*3]
print( int(((n[0]+n[1])*n[2])/2) )

Buggy submission (verdict: Runtime Error):
n = [int(inout()) for _ in [0]*3]
print( int(((n[0]+n[1])*n[2])/2) )
Problem p02923 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
H = input().split()

count = 0
max = 0
flag = []
for i in (range(int(N)-1)):
  if(int(H[i]) >= int(H[i+1])):
    flag.append(i)
  else:
    continue

H.append(10000000000)

for i in flag:
  for j in range(i,int(N)):
    if(max > int(N) - i):
      count = j - i
      break
    
    if(max > int(N) - j):
      count = j - i 
      break

    if(int(H[j]) >= int(H[j+1])):
      continue
    else:
      count = j - i
      break

  if (max < count):
    max = count
    count = 0

print(max)
~
Problem p02924 (python)

Fixed submission:
a = int(input())
a= (a*(a-1))//2
print(a)

Buggy submission (verdict: Runtime Error):
a = int(input())
a -=1
if a == 0:
  print(0)
else:
	ans = (ans*(ans-1))//2
	print(ans)
Problem p02947 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 25 08:58:11 2019

@author: avina
"""

n = int(input())
d = {}
for i in range(n):
  a = list(input())
  a.sort()
  a = ''.join(a)
  if a not in d:
    d[a] = 1
  else:
    d[a]+=1
ans = 0
for i in d:
    ans += ((d[i])*(d[i]-1))//2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n):
  a = input();k = 0
  for j in range(10):
    k+= ord(a[j]) - 95
  if k not in d:
    d[k] = 1
  else:
    d[k]+=1
if len(d) == 0:
  print(0)
else:
  print(max(d.values())
Problem p03061 (python)

Fixed submission:
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
 
X1 = [0] * (N+2)
X2 = [0] * (N+2)
 
for i in range(N):
    X1[i+1] = gcd(X1[i], A[i])
for i in range(N,0,-1):
    X2[i] = gcd(X2[i+1], A[i-1])

k = []
for i in range(N):
    k.append(gcd(X1[i],X2[i+2]))

print(max(k))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 09:49:38 2019

@author: avina
"""

from math import gcd
n = int(input())
l = list(map(int, input().strip().split()))
maxe = 0
     
for i in range(n):
    for j in range(n):
        if i != j:
            g = gcd(l[i],l[j])
            maxe = max(maxe, g)
print(maxe)

Buggy submission (verdict: Runtime Error):
def GCD(x, y): 
   if y > x:
      y,x = x,y
    while(y): 
       x, y = y, x % y 
  
   return x 
n = int(input())
l = list(map(int, input().strip().split()))
maxe = -1
     
for i in range(n):
    for j in range(n):
        if i != j:
            g = GCD(l[i],l[j])
            maxe = max(maxe, g)
print(maxe)

Buggy submission (verdict: Runtime Error):
from math import gcd
n = int(input())
l = list(map(int, input().strip().split()))
maxe = -1
     
for i in range(n):
    for j in range(n):
        if i != j:
            g = gcd(l[i],l[j])
            maxe = max(maxe, g)
print(maxe)

Buggy submission (verdict: Runtime Error):
from math import gcd
n = int(input())
l = list(map(int, input().strip().split()))
maxe = -1

for i in range(n):
  for j in range(n):
    g = gcd(l[i],l[j])
    maxe = max(maxe, g)
print(maxe)
Problem p03062 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Tue May 14 10:45:22 2019

@author: avina
"""

N = int(input())
L = list(map(int, input().strip().split()))
dp = [[0,0] for i in range(N+1)]
dp[0][1] = -1e7
for i in range(N):
    dp[i+1][0] = max(dp[i][0] + L[i], dp[i][1] - L[i])
    dp[i+1][1] = max(dp[i][1] + L[i], dp[i][0] - L[i])

print(dp[N][0])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input().strip().split()))
dp = [[0,0] for i in range(N+1)]
if L[0] >= 0:
    dp[0][1] = -L[0]
else:
    dp[0][1] = L[0]
for i in range(N):
    dp[i+1][0] = max(dp[i][0] + L[i], dp[i][1] - L[i])
    dp[i+1][1] = max(dp[i][1] + L[i], dp[i][0] - L[i])

print(min(dp[N][0]))
Problem p03071 (python)

Fixed submission:
a,b =map(int, input().strip().split())
if a == b:
  s = 2*b
else:
  e = max(a,b)
  s = 2*e - 1
print(s)

Buggy submission (verdict: Runtime Error):
a,b =map(int, input().strip().split())
if a == b:
  s = 2*b
else:
  e = max(a,b)
  s = 2*e - 1
print(e)
Problem p03102 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 18:16:09 2019

@author: avina
"""

N, M, C = map(int , input().strip().split())
B = list(map(int , input().strip().split()))
l = [];cnt = 0
for i in range(N):
  g = list(map(int , input().strip().split()))
  l.append(g)
for i in range(N):
  sums = 0
  for j in range(M):
    sums += l[i][j]*B[j]
  if sums + C > 0:
    cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N, M, C = map(int , input().strip().split())
B = list(map(int , input().strip().split()))
l = [];cnt = 0
for i in range(m):
  g = list(map(int , input().strip().split()))
  l.append(g)

for i in range(m):
  sums = 0
  for j in range(n):
    sums += l[i][j]*B[j]
  if sums + C >:
    cnt+=1
print(cnt)
Problem p02981 (python)

Fixed submission:
N,A,B = list(map(int, input().split(" ")))
print(min(A*N,B))

Buggy submission (verdict: Runtime Error):
min(A*N,B)
Problem p03014 (python)

Fixed submission:
import numpy as np

H, W = map(int, input().split())
S = []
for h in range(H):
  S.append(list(map(lambda s:0 if s=='#' else 1, input())))
S = np.array(S)
 
l,r,u,d = [np.zeros([H,W], dtype=int) for _ in range(4)]

for w in range(W):
  l[:,w] = (l[:,w-1]+1)*S[:,w]
  r[:,-w-1] = (r[:,-w]+1)*S[:,-w-1]

for h in range(H):
  u[h] = (u[h-1]+1)*S[h]
  d[-h-1] = (d[-h]+1)*S[-h-1]
  
ans = np.max((l+r+u+d-3)*S)

print(ans)

Buggy submission (verdict: Runtime Error):
H, W = [int(i) for i in input().split(" ")]
S = []
for i in range(H):
  S.append(input())
  
import numpy as np

r_lens = []
for s in S:
  counts = [len(block) for block in s.split("#")]
  
  r_len = []
  for c in counts:
    r_len+=[c]*c
    r_len+=[0]
  r_lens.append(r_len)
r_lens = np.array(r_lens)

S2 = [""]*W
for h in range(H):
  for w in range(W):
    S2[w] += S[h][w]
    
c_lens = []
for s in S2:
  counts = [len(block) for block in s.split("#")]
  
  c_len = []
  for c in counts:
    c_len+=[c]*c
    c_len+=[0]
  c_lens.append(c_len)
c_lens = np.array(c_lens)

print((r_lens+c_lens+1).max())