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

Fixed submission:
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(0,102)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(clist):
    if v == x:
        count = i
if count == 0:
    print(clist[1])
elif count == len(clist)-1:
    print(clist[-2])
else:
    minx = x - clist[count-1]
    maxx = clist[count+1]-x
    if minx > maxx:
        print(clist[count+1])
    else:
        print(clist[count-1])

Buggy submission (verdict: Runtime Error):
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(1,101)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(clist):
    if v == x:
        count = i
        print(len(clist),i,v,x)
if count == 0:
    print(clist[1])
elif count == len(clist)-1:
    print(clist[-2])
else:
    minx = x - clist[count-1]
    maxx = clist[count+1]-x
    if minx > maxx:
        print(clist[count+1])
    else:
        print(clist[count-1])

Buggy submission (verdict: Runtime Error):
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(1,101)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(alist):
    if v == int(x):
        count = i
if count == 0:
    print(alist[1])
elif count == 99:
    print(alist[-2])
else:
    minx = x - alist[count-1]
    maxx = alist[count+1]-x
    if minx > maxx:
        print(alist[count+1])
    else:
        print(alist[count-1])
Problem p02646 (python)

Fixed submission:
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B > A:
    length = B-A
else:
    length = A-B
if (V-W)*T < length:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B < A:
    length = B-A
else:
    length = A-B
else:
    if (V-W)*T < length:
        print('NO')
    else:
        print('YES')

Buggy submission (verdict: Runtime Error):
stdin = [input() for i in range(3)]
line = stdin[0]
A = int(line[0])
V = int(line[1])
line = stdin[1]
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
if (V-W)*T < B-A:
    print('NO')
else:
    print('YES')
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A B = list(map(int,input().split()))
print(A * B)
Problem p02677 (python)

Fixed submission:
import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
ang = ha -ma
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
e = math.cos(math.radians(ang))
d = a*a + b*b -2*a*b* e
#print(d)
c = math.sqrt(d)
print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))

Buggy submission (verdict: Runtime Error):
import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
if ma ==0 or ha ==0:
  ang = max(ma,ha)
else
ang =abs(ma-ha)
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
if ma == ha:
  print(b-a)
else:
  e = math.cos(math.radians(ang))
  #print(e)
  #print(-2*a*b*e)
  #print(a*a + b*b -2*a*b*e)
  d = a*a + b*b -2*a*b* e
  #print(d)
  c = math.sqrt(d)
  print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))
Problem p02694 (python)

Fixed submission:
import math
money = 100
x = int(input())
#print(x)
cnt = 0
while money < x:
  money += money * 0.01
  money = int(money)
  cnt += 1
  #print(cnt,money)
print(cnt)

Buggy submission (verdict: Runtime Error):
mport math
money = 100
x = int(input())
#print(x)
cnt = 0
while money <= x:
  money += money * 0.01
  money = int(money)
  cnt += 1
  #print(cnt,money)
print(cnt)
Problem p02909 (python)

Fixed submission:
s=input()
if s == 'Sunny':
  print('Cloudy')
if s== 'Cloudy':
  print('Rainy')
if s== 'Rainy':
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s=input()
if s == Sunny:
  print(Cloudy)
if s== Cloudy:
  print(Rainy)
if s== Rainy:
  print(Sunny)
Problem p02923 (python)

Fixed submission:
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
  else:
    counter = 0
print(countMax)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
    else:
      counter = 0
print(countMax)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
xh = []
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
    else:
      counter = 0
print(countMax)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
xh = []
#print(n)
#print(h)

for i in range(len(h)-1):
  #print(h[i],h[i+1])
  counter = 0
  #print(i,"kaime",h[i],"wohantei")
  while h[i] >= h[i+1]:
    #print(h[i],">",h[i+1],"counter+1",counter+1)
    counter += 1
    #print(counter)
    i += 1
    #print(i,h[i])
    #print("tugiha",h[i],"to",h[i+1],"wohanteisimasu")
    if i == n-1:
      break
  #print("whilekaranukemasu",h[i],h[i+1])
  xh.append(counter)
print(max(xh))
Problem p03543 (python)

Fixed submission:
s = input()
a = [int(c) for c in s]
if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
a = [int(c) for c in s]
  if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
  elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
  else:
    print("No")
Problem p03545 (python)

Fixed submission:
x = input()
#print(x)
y = [int(c) for c in x]
#print(y)
a = y[0]
b = y[1]
c = y[2]
d = y[3]
if a+b+c+d == 7:
  print(a,"+",b,"+",c,"+",d,"=",a+b+c+d, sep='')
  exit()
if a+b+c-d == 7:
  print(a,"+",b,"+",c,"-",d,"=",a+b+c-d, sep='')
  exit()
if a+b-c+d == 7:
  print(a,"+",b,"-",c,"+",d,"=",a+b-c+d, sep='')
  exit()
if a-b+c+d == 7:
  print(a,"-",b,"+",c,"+",d,"=",a-b+c+d, sep='')
  exit()
if a-b-c+d == 7:
  print(a,"-",b,"-",c,"+",d,"=",a-b-c+d, sep='')
  exit()
if a-b+c-d == 7:
  print(a,"-",b,"+",c,"-",d,"=",a-b+c-d, sep='')
  exit()
if a-b-c-d == 7:
  print(a,"-",b,"-",c,"-",d,"=",a-b-c-d, sep='')
  exit()
if a+b-c-d == 7:
  print(a,"+",b,"-",c,"-",d,"=",a+b-c-d, sep='')
  exit()

Buggy submission (verdict: Runtime Error):

#print(x)
y = [int(c) for c in x]
#print(y)
a = y[0]
b = y[1]
c = y[2]
d = y[3]
if a+b+c+d == 7:
  print("a+b+c+d=",a+b+c+d,sep='')
  exit()
if a+b+c-d == 7:
  print("a+b+c-d=",a+b+c-d,sep='')
  exit()
if a+b-c+d == 7:
  print("a+b-c+d=",a+b-c+d,sep='')
  exit()
if a-b+c+d == 7:
  print("a-b+c+d=7")
  exit()
if a-b-c+d == 7:
  print("a-b-c+d=7")
  exit()
if a-b+c-d == 7:
  print("a-b+c-d=7")
  exit()
if a-b-c-d == 7:
  print("a-b-c-d=7")
  exit()
if a+b-c-d == 7:
  print("a+b-c-d=7")
  exit()
Problem p02608 (python)

Fixed submission:
n=int(input())
a = [0]*(20000)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            if i**2+j**2+k**2 >= n:
                break
            a[i**2+j**2+k**2+i*j+j*k+i*k]+=1
for i in range(1,n+1):
    print(a[i])

Buggy submission (verdict: Runtime Error):
n=int(input())
a = [0]*(10000)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            if i**2+j**2+k**2 >= n:
                break
            a[i**2+j**2+k**2+i*j+j*k+i*k]+=1
for i in range(1,n+1):
    print(a[i])
Problem p02675 (python)

Fixed submission:
N = input()
N = int(N)
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")
elif (N % 100) % 10 in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
N = input()
if (N % 100) % 10 in [2,4,5,7,9]:
  print("on")
elif (N % 100) % 10 in [0,1,6,8]:
  print("hon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
if (N % 100) % 10 == 3:
  print("bon")
if (N % 100) % 10 in [0,1,6,8]:
  print("pon")
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")
Problem p03545 (python)

Fixed submission:
import sys
a,b,c,d = input()
for i in ["+","-"]:
    for j in ["+","-"]:
        for k in ["+","-"]:
                if eval(a+i+b+j+c+k+d) == 7:
                    print(a+i+b+j+c+k+d+ "=7")
                    sys.exit()

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
for i in ["+","-"]:
    for j in ["+","-"]:
        for k in ["+","-"]:
                if eval(a+i+b+j+c+k+d) == 7:
                    print(a+i+b+j+c+k+d+ "=7")
Problem p02658 (python)

Fixed submission:
import sys
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
  sys.exit()
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        sys.exit()
    else:
        continue
    
  if ans>1000000000000000000:
      print(-1)
  else:
      print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort()
if li[0]==0:
  print(0)
else:
  ans=1
  for i in li:
    ans*=i
    if ans>1000000000000000000:
        print(-1)
        exit()
    else:
        continue
print(ans)

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

if 0 in li:
  print(0)
  exit
else:
  ans=1
  for i in li:
    ans*=i
    if ans>10**18:
        print(-1)
        exit
    else:
        continue
    
print(ans)
Problem p02696 (python)

Fixed submission:
a,b,n = map(int, input().split())
i = min(n,b-1)
print(int(a*i/b) - a*int(i/b))

Buggy submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
a=[]
for i in range(1,n+1):
  a.append(int(a*i/b)-5*int(i/b))
print(max(a))
Problem p03408 (python)

Fixed submission:
import collections

n=int(input())
lb=[input() for i in range(n)]
m=int(input())
lr=[input() for i in range(m)]

for i in range(len(lr)):
    if lr[i] in lb:
        lb.remove(lr[i])
    else:
        pass
if lb==[]:
    ans=0
else:
    s=collections.Counter(lb)
    ans=s.most_common()[0][1]      

print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
b=[input() for i in range(n)]
m=int(input())
r=[input() for i in range(m)]
ans=[0]
for i in set(b)
    ans.append(b.count(i)-r.count(i))
print(max(ans))
Problem p03624 (python)

Fixed submission:
n=input()

la=[chr(ord('a') + i) for i in range(26)]
for i in la:
    if i not in n:
      print(i)
      exit()
print("None")

Buggy submission (verdict: Runtime Error):
n=input()
l=sorted(n)
li=list(set(l))
li.sort()
la=[chr(ord('a') + i) for i in range(26)]
ans=""
for i in range(26):
    if li[i]!=la[i]:
        ans=la[i]
        break
    else:
        pass

if ans=="":
  print("None")
else:
  print(ans)
Problem p02613 (python)

Fixed submission:
N=int(input())
S=[input() for i in range(N)]

A=S.count('AC')
B=S.count('WA')
C=S.count('TLE')
D=S.count('RE')

print('AC x',A)
print('WA x',B)
print('TLE x',C)
print('RE x',D)

Buggy submission (verdict: Runtime Error):
N=int(N)
S=[input() for i in range(N)]

A=S.count('AC')
B=S.count('WA')
C=S.count('TLE')
D=S.count('RE')

print('AC x',A)
print('WA x',B)
print('TLE x',C)
print('RE x',D)

Buggy submission (verdict: Runtime Error):
N=int(N)
S=[input() for i in range(N)]

A=S.count('AC')
B=S.count('WA')
C=S.count('TLE')
D=S.count('RE')

print('AC x'+ A)
print('WA x'+ B)
print('TLE x'+ C)
print('RE x'+ D)
Problem p02640 (python)

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

if(Y%2==0 and 2*X<=Y<=4*X):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input.split())

if(Y%2==0 and 2*X<=Y<=4*X):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X,Y=map(int,input.split())

if(Y%2 & 2*X<=Y<=4*X):
  print('Yes')
else:
  print('No')
Problem p02657 (python)

Fixed submission:
A,B=input().split()
C=int(A)*int(B)
print(C)

Buggy submission (verdict: Runtime Error):
A,B=input().split()
C=A*B
print(C)
Problem p02607 (python)

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

cnt = 0
for i in range((n + 1)// 2):
    if num[2*i] % 2 == 1:
        cnt += 1
print(cnt)

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

cnt = 0
for i in range( n // 2 + 1):
    print((2*i + 1))
    if num[2*i] % 2 == 1:
        cnt += 1
print(cnt)
Problem p02923 (python)

Fixed submission:
from itertools import groupby
n = int(input())
h = list(map(int,input().split()))

h_diff = []
for i in range(len(h)-1):
    h_diff.append(h[i+1] - h[i])
    
result = [sum(item) for val, item in groupby([1 if x > 0 else -1 for x in h_diff])] + [0]
print(-min(result))

Buggy submission (verdict: Runtime Error):
from itertools import groupby
n = int(input())
h = list(map(int,input().split()))

h_diff = []
for i in range(len(h)-1):
    h_diff.append(h[i+1] - h[i])
    
result = [sum(item) for val, item in groupby([1 if x > 0 else -1 for x in h_diff])]
print(-min(result))
Problem p02934 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
s = 0 
for i in l:
    i_inv = 1/i
    s += i_inv
print(1/s)

Buggy submission (verdict: Runtime Error):
n = int(input())
l =[]
inv =[]
s = 0
for i in range(n):
    l.append(int(input()))

for i in l:
    i_inv = 1/i
    s += i_inv
print(1/s)

Buggy submission (verdict: Runtime Error):
n = int(input())
l =[]
inv =[]
s = 0
for i in range(n):
    l.append(int(input()))

for i in l:
    i_inv = 1/i
    inv.append(i_inv)

for i in inv:
    s += i
print(1/s)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
SUM = a+b
SUB = a-b
PRO = a*b
print(max(SUM,SUB,PRO)
Problem p03102 (python)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
for i in range(n):
    A = list(map(int,input().split()))
    ans = 0
    for j in range(m):
        ans += A[j]*b[j]
    ans = ans + c
    if ans > 0:
        count+= 1
print(count)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
ans = 0
for i in range(n):
    A = list(map(int,input().split()))
    for j in range(m):
        ans += A[j]*b[j]
    ans = ans + c
    if ans > 0:
        tmp += 1
print(tmp)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
for i in range(n):
    A = list(map(int,input().split()))
    for j in range(m):
        ans = A[j]*b[j]
        ans = ans+ c
    if ans > 0:
        tmp += 1
print(tmp)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
for i in range(n):
    A = list(map(int,input().split()))
    for j in range(m):
        ans = A_i[j]*b[j] + c
    if ans > 0:
        tmp += 1
print(tmp)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
count = 0
for i in range(n):
    A = list(map(int,input().split()))
    for j in range(len(m)):
        ans = A_i[j]*b[j] + c
    if ans > 0:
        tmp += 1
print(tmp)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
tmp = 0
for i in range(n):
    A_i = list(map(int,input().split()))
    for _ in range(len(m)):
        ans = A_i[_]*b[_] + c
    if ans >= 0:
        tmp = tmp + 1
print(tmp)
Problem p03136 (python)

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

m = max(l)
SUM = sum(l) - m

if m < SUM:
  print('Yes')
else:
  print('No')

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

for i in range(N):
  n = int(input())
  l.append(n)
  
m = max(l)
SUM = sum(l) - m
 
if m < SUM:
  print('Yes')
else:
  print('No')

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

for i in range(N):
  n = int(input())
  l.append(n)
 
m = max(l)
SUM = sum(l) - m
 
if m < SUM:
  print("Yes")
else:
  print("No")

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

for i in range(N):
  n = int(input())
  l.append(n)
 
m = max(l)
SUM = sum(l) - m
 
if m > SUM:
  print("Yes")
else:
  print("No")

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

for i in range(N):
  n = int(input())
  l.append(n)
 
m = max(l)
SUM = sum(l) - m
 
if m > SUM:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
l = list[]

for i in N:
  n = int(input())
  l.append(n)

m = l.max()
SUM = l.sum() - m

if m > SUM:
  print("YES")
else:
  print("NO")
Problem p03239 (python)

Fixed submission:
n, T = map(int, input().split())
a = 1001
for i in range(n):
    c, t = map(int, input().split())
    if t <= T:
        a = min(a,c)
if a == 1001:
    print("TLE")
else:
    print(a)

Buggy submission (verdict: Runtime Error):
n, T = map(int, input().split())
a = 1001
for i in range(n):
  c, t = map(int, input().split())
  if t < T:
    a = min(a.c)
if a == 1001:
  print("TLE")
else:
  print(a)
Problem p03292 (python)

Fixed submission:
l= list(map(int, input().split()))
l.sort()
print(l[2] - l[0])

Buggy submission (verdict: Runtime Error):
l= list(map(int, input()))
l.sort()
print(l[2] - l[1])
Problem p03370 (python)

Fixed submission:
n,x=map(int,input().split())
l=[int(input()) for _ in range(n)]
print(n+((x-sum(l))//min(l)))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = []
for i in range(n):
    l.append(int(input())
print(int((x- sum(l)) // min(l)))
Problem p03606 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(n):
  l, r = map(int, input().split())
  sum += r-l+1
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(n):
  l, r = map(int, input().split())
  sum + = r-l+1
print(sum)
Problem p03796 (python)

Fixed submission:
n=int(input())
ans=1
for i in range(1,n+1):
  ans*=i
  ans%=10**9+7
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
 
prod = 1
for i in range(1,n+1):
    prod *= i
    ans = ans%(10**9+7)
print(ans)
Problem p03827 (python)

Fixed submission:
n = int(input())
s = input()
x = 0
l = [0]
for i in range(n):
  if s[i] == "I":
    x += 1
    l.append(x)
  else:
    x -= 1
    l.append(x)
print(max(l))

Buggy submission (verdict: Runtime Error):
n = input()
s=input()
c,m=0,0
for i in range(n):
    if s[i]=="I":
        c+=1
        m=max(c,m)
    if s[i]=="D":
        c-=1
        m=max(c,m)
print(m)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x = 0
l = [0]
for i in range(n):
  if s[i] == "I":
    x += 1
  	l.append(x)
  else:
    x -= 1
    l.append(x)
print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x = 0
l = [0]
for n in range(n):
  if s[n] == "I":
    x += 1
  	l.append(x)
  else:
    x -= 1
    l.append(x)
print(max(l))
Problem p04030 (python)

Fixed submission:
s = input()
t = []
for x in s:
  if x =="B":
    try:t.pop()
    except:pass
  else:
    t.append(x)
print("".join(t))

Buggy submission (verdict: Runtime Error):
s = input()
t = []
for x in s:
  if x =="B":
    try:t.pop()
    except:pass
  else:
    t.append(x)
print("".joint(t))
Problem p02642 (python)

Fixed submission:
n = int(input())
lis = list(map(int, input().split()))
maxL = max(lis)+1
t = [0] * maxL
lis.sort()
for k in lis:
    t[k] += 1
    if t[k] == 1:
        for p in range(k * 2, maxL, k):
            t[p] += 2
print(t.count(1))

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
lis = list(map(int, input().split()))

t = [0]*(10**6)

for p in range(n):
    t[lis[p]] = 1

count =n
for p in range(n):
    for k in make_divisors(lis[p]):
        #print(str(p) +" " + str(k))
        if t[k] == 1:
            if lis[p] != k or lis.count(lis[p]) > 1:
                count -= 1
                break
print(count)

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())
lis = list(map(int, input().split()))

t = [0]*(10**6)

for p in range(n):
    t[lis[p]] = 1

count =n
for p in range(n):
    for k in sympy.divisors(lis[p]):
        #print(str(p) +" " + str(k))
        if t[k] == 1:
            if lis[p] != k or lis.count(lis[p]) > 1:
                count -= 1
                break
print(count)
Problem p02646 (python)

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

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

n=int(input())

if w<=y:

  print("NO")

else:

  print("YES") if abs(a-b)/(w-y)<=n else print("NO")

Buggy submission (verdict: Runtime Error):
a,w=map(int,input().split())
b,y=map(int,input().split())
n=int(input())
if w=y:
  print(”NO")
else:
  print("YES") if abs(a-b)/(w-y)<=n else print("NO")

Buggy submission (verdict: Runtime Error):
a,w=map(int,input().split())
b,y=map(int,input().split())
n=int(input())
print("YES") if abs(a-b)/(w-y)<=n else print("NO")

Buggy submission (verdict: Runtime Error):
a,w=map(int,input().split())
b,y=map(int,input().split())
n=int(input())
print("YES") if abs(a-b)/(w-y)<n else print("NO")
Problem p03211 (python)

Fixed submission:
s = input()
l = len(s)
r = 10000
for i in range(l-2):
	p = s[i] + s[i+1] + s[i+2]
	x = int(p)
	r = min(r, abs(x-753))
print(r)

Buggy submission (verdict: Runtime Error):
s = input()
l = len(s)
r = 10000
for i in range(l-3):
	p = s[i] + s[i+1] + s[i+2]
    x = int(p)
    r = min(r, abs(x-753))
print(r)
Problem p02621 (python)

Fixed submission:
a = int(input())
x = a+(a*a)+(a*a*a)
print(x)

Buggy submission (verdict: Runtime Error):
int a
int x
x = a+(a*a)+(a*a*a)
ptint(x)
Problem p02606 (python)

Fixed submission:
L, R, d = map(int,input().split())
if(L%d != 0):
  print(R//d-L//d)
else:
  print(R//d-L//d + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
O = [i for i in range(N) if(i%2==0 and A[i]%2==1)]
print(len(O))
Problem p02621 (python)

Fixed submission:
a=int(input())
l = [a**i for i in range(4)]
print(sum(l)-1)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
k=0
for i in range(len(S)):
  if(S[i] != T[i]):
    k = k+1
print(k)