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

Fixed submission:
s=input()
q=int(input())
head=[]
tail=[]
rev=False
for _ in range(q):
  tmp=list(input().split())
  if tmp[0]=='1':
    if rev==False:
      rev=True
    else:
      rev=False
  if tmp[0]=='2':
    if rev==False:
      if tmp[1]=='1':
        head.append(tmp[2])
      if tmp[1]=='2':
        tail.append(tmp[2])
    if rev==True:
      if tmp[1]=='1':
        tail.append(tmp[2])
      if tmp[1]=='2':
        head.append(tmp[2])
head=''.join(map(str,head))
tail=''.join(map(str,tail))
ans=head[::-1]+s+tail
if rev==True:
  ans=ans[::-1]
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    f,c = map(str,input().split())
    if int(f) == 1:
      s = c + s
    else:
      s = s + c
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    continue
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    f,c = input().split()
    if int(f) == 1:
      s = c + s
    else:
      s = s + c
print(s)

Buggy submission (verdict: Runtime Error):
s = input()
q = int(input())
for i in range(q):
  n = int(input())
  if n == 1:
    s = s[::-1]
  else:
    f,c = int(input()),input()
    if f == 1:
      s = c + s
    else:
      s = s + c
print(s)
Problem p02765 (python)

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

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))

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

if n > 10:
  print(r)
elif n = 10:
  print(r)
else:
  print(r+100*(10-n))

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

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))
Problem p02767 (python)

Fixed submission:
n = int(input())
X = list(map(int,input().split()))
ans = 10**100
for i in range(1,101):
  count = 0
  for j in X:
    count += (i-j)**2
  ans = min(ans,count)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
X = list(map(int,input().split)())
ans = 10**100
for i in range(1,101):
  count = 0
  for j in X:
    count += (i-j)*2
  ans = min(ans,count)
print(ans)
Problem p02768 (python)

Fixed submission:
mod = 10**9+7
n,a,b = map(int,input().split())
ans = pow(2,n,mod)-1

comb1 = 1 
for i in range(n-a+1,n+1):
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1):
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod

comb2=1
for i in range(n-b+1,n+1):
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
  
ans -= (comb1+comb2)
ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n,a,b = map(int,input().split())
mod = 10**9+7
total = pow(2,n,mod) - 1

nPa = math.factorial(n) // math.factorial(n-a) 
nPa %= mod
nPb = math.factorial(n) // math.factorial(n-b) 
nPb %= mod
a!_1 = 1
for i in range(1,a+1):
  a!_1 = pow(i,mod-2,mod)
  a!_1 %= mod
b!_1 = 1
for i in range(1,b+1):
  b!_1 = pow(i,mod-2,mod)
  b!_1 %= mod
nCa = nPa * a!_1
nCb = nPb * b!_1
print((total-nCa-nCb)%mod)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
mod = 10**9+7
ALL = pow(2,n,m)-1
x = y = 1
for i in range(b):
    x = x * (i+1)%m
    y = y * (n-i)%m
    if i + 1 == a:
        a = b
        ALL -= y * pow(x,m-2,m)
print(ALL%m)
Problem p02772 (python)

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

POINT = 0
for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 10 != 0:
            POINT = 1
if POINT == 1:
  print("DENIED")
else:
  print("APPROVED")

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for a in A:
  if a % 2 == 0:
    if a % 3 == 0 or a % 5 == 0:
      ans = 1
      break()
      
if ans == 1:
  print(APPROVED)
else:
  print(DENIED)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
ans = 1
for a in A:
  if a % 2 == 0:
    if a % 3 != 0 or a % 5 != 0:
      ans = 0
      break()
      
if ans:
  print(APPROVED)
else:
  print(DENIED)
Problem p02778 (python)

Fixed submission:
s = list(input())
n = len(s)
print('x'*n)

Buggy submission (verdict: Runtime Error):
s = input()
for i in s:
  s[i]=x
print(s)
Problem p02783 (python)

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

ans = 0

while h > 0:
    ans += 1
    h -= a

print(ans)

Buggy submission (verdict: Runtime Error):
n,a = map(int,input())
if n%a == 0:
  print(n//a)
else:
  print(n//a +1)
Problem p02784 (python)

Fixed submission:
h,n = map(int,input().split())
a = list(map(int,input().split()))
if sum(a) >= h:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = (map(int,input().split())) for i in range(n):
  if h > sum(sp):
    print('No')
  else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = (map(int,input().split())) for i in range(n)
if h > sum(sp):
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
h,n = map(int,input().split())
sp = [list(map(int,input().split()))for i in range(n)]
if h > sum(sp):
  print('No')
else:
  print('Yes')
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
    min_p = i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
     min_p = i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    ans += 1
     min_p = i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
ans = 0
min_p = p[0]
for i in p:
  if i <= min_p:
    cnt += 1
     min_p = i
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
for i in range(n)
  if p[i] < p[i+1]:
    p.pop(i+1)
print(p.count())
Problem p02801 (python)

Fixed submission:
A = str(input(''))
if A == 'a':
  print('b')
elif A == 'b':
  print('c')
elif A == 'c':
  print('d')
elif A == 'd':
  print('e')
elif A == 'e':
  print('f')
elif A == 'f':
  print('g')
elif A == 'g':
  print('h')
elif A == 'h':
  print('i')
elif A == 'i':
  print('j')
elif A == 'j':
  print('k')
elif A == 'k':
  print('l')
elif A == 'l':
  print('m')
elif A == 'm':
  print('n')
elif A == 'n':
  print('o')
elif A == 'o':
  print('p')
elif A == 'p':
  print('q')
elif A == 'q':
  print('r')
elif A == 'r':
  print('s')
elif A == 's':
  print('t')
elif A == 't':
  print('u')
elif A == 'u':
  print('v')
elif A == 'v':
  print('w')
elif A == 'w':
  print('x')
elif A == 'x':
  print('y')
else:
  print('z')

Buggy submission (verdict: Runtime Error):
A = str(input(''))
if A = 'a':
  print('b')
elif A = 'b':
  print('c')
elif A = 'c':
  print('d')
elif A = 'd':
  print('e')
elif A = 'e':
  print('f')
elif A = 'f':
  print('g')
elif A = 'g':
  print('h')
elif A = 'h':
  print('i')
elif A = 'i':
  print('j')
elif A = 'j':
  print('k')
elif A = 'k':
  print('l')
elif A = 'l':
  print('m')
elif A = 'm':
  print('n')
elif A = 'n':
  print('o')
elif A = 'o':
  print('p')
elif A = 'p':
  print('q')
elif A = 'q':
  print('r')
elif A = 'r':
  print('s')
elif A = 's':
  print('t')
elif A = 't':
  print('u')
elif A = 'u':
  print('v')
elif A = 'v':
  print('w')
elif A = 'w':
  print('x')
elif A = 'x':
  print('y')
else:
  print('z')

Buggy submission (verdict: Runtime Error):
A = input()
if A = 'a':
  print('b')
elif A = 'b':
  print('c')
elif A = 'c':
  print('d')
elif A = 'd':
  print('e')
elif A = 'e':
  print('f')
elif A = 'f':
  print('g')
elif A = 'g':
  print('h')
elif A = 'h':
  print('i')
elif A = 'i':
  print('j')
elif A = 'j':
  print('k')
elif A = 'k':
  print('l')
elif A = 'l':
  print('m')
elif A = 'm':
  print('n')
elif A = 'n':
  print('o')
elif A = 'o':
  print('p')
elif A = 'p':
  print('q')
elif A = 'q':
  print('r')
elif A = 'r':
  print('s')
elif A = 's':
  print('t')
elif A = 't':
  print('u')
elif A = 'u':
  print('v')
elif A = 'v':
  print('w')
elif A = 'w':
  print('x')
elif A = 'x':
  print('y')
else:
  print('z')
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=1
print(AC,WA)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
L = [0]*n
AC = 0
WA = 0
tmp = [0]*n
for i in range(m):
	x,y = input().split()
	x = int(x)
	if L[x-1] == 0:
		if y == "WA":
			tmp[x-1] += 1
		else:
			AC += 1
			WA += tmp[x-1]
			L[x-1]=1
print(A,W)
Problem p02812 (python)

Fixed submission:
n = int(input())
s = str(input())
print(s.count('ABC'))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(inout())
print(s.count('ABC'))
Problem p02813 (python)

Fixed submission:
from itertools import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))

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

A = [i for i in range(1,n+1)]

for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))

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

A = [i+1 for i in range(n)]



for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))

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

A = [i+1 for i in range(N)]

from itertools import permutations

for i,per in enumerate(list(permutations(A))):
  if per == P:
    x = i
  if per == Q:
    y = i
  
print(abs(x-y))

Buggy submission (verdict: Runtime Error):
import permutations
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

a = [i+1 for i in range(n)]
for i,per in enumerate(list(permutations(a))):
    if per == p:
        x = i
    if per == q:
        y = i
print(abs(x-y))
Problem p02844 (python)

Fixed submission:
n = int(input())
s = input()
lst = [0] * 1000
for i in range(1000):
    if len(str(i)) == 1:
        tmp = '00' + str(i)
        lst[i] = tmp
    elif len(str(i)) == 2:
        tmp = '0' + str(i)
        lst[i] = tmp
    else:
        lst[i] = str(i)

cnt = 0
for v in lst:
    id_1 = s.find(v[0])
    if id_1 == -1:
        continue
    id_2 = s.find(v[1], id_1 + 1)
    if id_2 == -1:
        continue
    id_3 = s.find(v[2], id_2 + 1)
    if id_3 == -1:
        continue
    cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
ans = []
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      a = s[i]+s[j]+s[k]
      ans.apeend(a)
ans = set(ans)
print(len(ans))
Problem p02853 (python)

Fixed submission:
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a == b == 1:
  print(1000000)
elif a < 3:
  if b < 3:
    print(100000*(4-a)+100000*(4-b))
  else:
    print(1000000*(4-a))
else:
  if b < 3:
    print(1000000*(4-b)
  else:print(0)
Problem p02861 (python)

Fixed submission:
N=int(input())
import math

XY=[[int(x) for x in input().rstrip().split()] for i in range(N)]

ans=0
for i in range(N):
  for j in range(N):
    if i<j:
      ans+=math.sqrt((XY[i][0]-XY[j][0])**2+(XY[i][1]-XY[j][1])**2)
bb=1
for i in range(1,N+1):
  bb*=i

print(2*ans/N)

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

XY = [[int(x) for x in input().rstrip().split()] for i in range(N)]

ans = 0
for i in range(N):
  for j in range(N):
    if i < j:
      ans += math.sqrt((XY[i][0]-XY[j][0])**2+(XY[i][1]-XY[j][1])**2)
bb = 1
for i in range(1,N+1):
  bb* = i

print(2*ans/N)
Problem p02886 (python)

Fixed submission:
N=int(input())
D=list(map(int,input().split()))
print((sum(D)**2-sum(d*d for d in D))//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = list(map(int,input().split()))
ans = 0
for i in range(n):
  for j in range(i+1,n+1):
    ans += d[i]*d[j]
print(ans)
Problem p02898 (python)

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

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
ans = 0
a = list[map(int,input().split())]
for i in range(n):
  if a[i] >= k:
    ans += 1
print(ans)
Problem p02909 (python)

Fixed submission:
n = input()
if n == 'Sunny':
  print('Cloudy')
elif n == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
n = input()
if n == Sunny:
  print('Cloudy')
elif n == Cloudy:
  print('Rainy')
else:
  print('Sunny')
Problem p02911 (python)

Fixed submission:
n,k,q=map(int,input().split())
a=[int(input()) for i in range(q)]
p=[0]*n
for i in a:
  p[i-1]+=1
for j in p:
  if k-(q-j)>0:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
l = [0]*q
for _ in range(q):
  a = int(input())
  l[a-1] = +1
for i in range(len(q)):
  if l[i] >= 1:
    print('Yes')
  else:
    print('No')
Problem p02922 (python)

Fixed submission:
a,b = map(int,input().split())
c = 1 
ans = 0
while c < b:
  c += a-1
  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = 1 
ans = 0
for i in range():
  if c >= b:
    break
  else:
    c += a-1
    ans += 1
print(ans)
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print(n(n+1)//2-n)
Problem p02945 (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 p02946 (python)

Fixed submission:
k,x = map(int,input().split())
for a in range(x-k+1,x+k):
    print(a ,end=" ")

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
for a in range(x-k+1,x+i):
    print(a ,end=" ")

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range(b:a+1)
print(l)

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = range[b:a+1]
print(l)

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x+k-1
b = x-k+1
l = rane[b:a+1]
print(l)
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().split())
if (a+b) % 2 == 0:
  print((abs(x)+abs(y))//2)
else:
  print('IMPOSSIBLE')
Problem p02981 (python)

Fixed submission:
n,a,b = map(int,input().split())
if n*a >= b:
  print(b)
else:
  print(n*a)

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
if n*a >= b:
  print(b)
else:
  priny(n*a)
Problem p02988 (python)

Fixed submission:
n = int(input())
s = list(map(int,input().split()))
ans = 0
for i in range(n-2):
    a,b,c = s[i:i+3]
    if a<b<c or c<b<a:  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(map(int,input().split()))
ans = 0
for i in range(n-2):
    a,b,c=p[i:i+3]
    if a<b<c or c<b<a:  ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
  if a[i] < a[i+1] < a[i+2]:
    ans += 1
print(ans)
Problem p02994 (python)

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

A = [L + i for i in range(N)]
A.sort(key=lambda a: abs(a))

print(sum(A) - A[0])

Buggy submission (verdict: Runtime Error):
N,L = map(int,input().split())
A = [L+i for i in range(N)]
A.sort(a: abs(a))

print(sum(A)-A[0])
Problem p02995 (python)

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

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

def F(N,C,D):
  x = N
  x -= N//C
  x -= N//D
  lcm = C*D//gcd(C,D)
  x += N//lcm
  return x

answer = F(B,C,D) - F(A-1,C,D)
print(answer)

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())
cd = math.gcd(c, d)
lcmcd = c*d//cd
ans = 0
for i in range(a,b+1):
  if i % lcmcd != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())
cd = math.gcd(c, d)
lcm(cd) = c*d//cd
ans = 0
for i in range(a,b+1):
  if i % lcm(cd) != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(int(a),int(b)+1,))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1,1))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a, b+1))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(b))
ans = 0

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(b))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a, b+1))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0
for i in range(len(l)):
  if l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0
for i in range(len(l)):
  l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
l = list(range(a,b+1))
ans = 0
for i in l:
  l[i] % c != 0 and l[i] % d != 0:
    ans += 1
print(ans)
Problem p02999 (python)

Fixed submission:
x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x,a = map(int,input().split())
if x >= a:
  print(10)
else:
  priny(0)
Problem p03005 (python)

Fixed submission:
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Buggy submission (verdict: Runtime Error):
n,k = int(input()),int(input())
if n == k or n == 1:
  print(0)
else:
  print(n-k)
Problem p03029 (python)

Fixed submission:
a,p = map(int,input().split())
if 3*a+p < 2:
  print(0)
elif (3*a+p) % 2 == 0:
  print((3*a+p)//2)
else:
  print((3*a+p-1)//2)

Buggy submission (verdict: Runtime Error):
a,p = map(int,input().split())
if 3*a+b < 2:
  print(0)
elif (3*a+b) % 2 == 0:
  print((3*a+b)//2)
else:
  print((3*a+b-1)//2)
Problem p03037 (python)

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

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
l_max,r_min = 0,n
for i in range(m):
    l,r = map(int,input().split())
    l_max = max(l,ll)
    r_min = min(r,rr)
print(max(r_min - l_max +1 , 0))
Problem p03048 (python)

Fixed submission:
R,G,B,N = map(int,input().split())
count = 0
for i in range(3001):
	for j in range (3001):
		if i*R+j*G<=N:
			tmp = N-(i*R+j*G)
			if tmp % B == 0:
				count += 1
print(count)

Buggy submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(3001):
  for j in range(3001):
    for k in range(3001):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    for k in range(n//b+1):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(n//r+1):
  for j in range(n//g+1):
    for k in range(n//b+1):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
r,g,b,n = map(int,input().split())
ans = 0
for i in range(r):
  for j in range(g):
    for k in range(b):
      if i*r + j*g + k*b = n:
        ans += 1
print(ans)
Problem p03062 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
INF = 10**9

dp0 = [0]
dp1 = [-INF-1]

for i, x in enumerate(A):
  dp0.append( max(dp0[i] + x, dp1[i] - x) )
  dp1.append( max(dp0[i] - x, dp1[i] + x) )

print(dp0[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
for i in range(n):
  if A[i]<0 and A[i+1]<0:
    A[i] = -A[i]
    A[i+1] = -A[i]
  elif A[i]<0:
    if A[i]-A[i+1]<0:
      A[i] = -A[i]
      A[i+1] = -A[i]
print(sum(A))
Problem p03068 (python)

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] != s[k-1]:
    s = s.replace(s[i], '*')
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = str(S[l-1])
for i in range(n):
  if S[i] != A:
    S[i] = '*'
print(S)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = S[l+1]
for i in range(n):
  if S[i] != A:
    S[i] = '*'
print(S)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = input()
l = int(input())
A = S[l+1]
for i in range(n):
  if S[i] != A:
    S[i] = A
print(S)
Problem p03071 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b-1))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ptint(max(a+a-1,a+b,b+b)
Problem p03076 (python)

Fixed submission:
A = 0
B = []
B.append(0)
for i in range(5):
  I = int(input())
  A += I
  T = I % 10
  if T != 0:
    B.append(10 - T)
print(A + sum(B) - max(B))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a%10
B = b%10
C = c%10
D = d%10
E = e%10
List =[A,B,C,D,E]
ans = 0
for i in range(5):
  if l[i] % 10 != 0:
    mini = min(9,l[i])
print(a+b+c+d+e+A+B+C+D+E-(10-mini))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = a%10
B = b%10
C = c%10
D = d%10
E = e%10
list =[a,b,c,d,e]
ans = 0
for i in range(5):
  if l[i] % 10 != 0:
    mini = min(9,l[i])
print(a+b+c+d+e+A+B+C+D+E-mini)