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

Fixed submission:
A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[int(input()) for i in range(N)]
if A11 in b and A12 in b and A13 in b:
    print('Yes')
elif A21 in b and A22 in b and A23 in b:
    print('Yes')
elif A31 in b and A32 in b and A33 in b:
    print('Yes')
elif A11 in b and A21 in b and A31 in b:
    print('Yes')
elif A12 in b and A22 in b and A32 in b:
    print('Yes')
elif A13 in b and A23 in b and A33 in b:
    print('Yes')
elif A11 in b and A22 in b and A33 in b:
    print('Yes')
elif A13 in b and A22 in b and A31 in b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11, A12, A13 in b:
    print('Yes')
elif A21, A22, A23 in b:
    print('Yes')
elif A31, A32, A33 in b:
    print('Yes')
elif A11, A21, A31 in b:
    print('Yes')
elif A12, A22, A32 in b:
    print('Yes')
elif A13, A23, A33 in b:
    print('Yes')
elif A11, A22, A33 in b:
    print('Yes')
elif A13, A22, A31 in b:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A11, A12, A13=list(map(int,input().split()))
A21, A22, A23=list(map(int,input().split()))
A31, A32, A33=list(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 in b and A12 in b and A13 in b:
    print('Yes')
elif A21 in b and A22 in b and A23 in b:
    print('Yes')
elif A31 in b and A32 in b and A33 in b:
    print('Yes')
elif A11 in b and A21 in b and A31 in b:
    print('Yes')
elif A12 in b and A22 in b and A32 in b:
    print('Yes')
elif A13 in b and A23 in b and A33 in b:
    print('Yes')
elif in b A11 and A22 in b and A33 in b:
    print('Yes')
elif A13 in b and A22 in b and A31 in b:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A11, A12, A13=list1(map(int,input().split()))
A21, A22, A23=list2(map(int,input().split()))
A31, A32, A33=list3(map(int,input().split()))
N=int(input())
b=[input() for i in range(N)]
if A11 and A12 and A13 in b:
    print('Yes')
elif A21 and A22 and A23 in b:
    print('Yes')
elif A31 and A32 and A33 in b:
    print('Yes')
elif A11 and A21 and A31 in b:
    print('Yes')
elif A12 and A22 and A32 in b:
    print('Yes')
elif A13 and A23 and A33 in b:
    print('Yes')
elif A11 and A22 and A33 in b:
    print('Yes')
elif A13 and A22 and A31 in b:
    print('Yes')
else:
  print('No')
Problem p02767 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
ans = float("inf")
for p in range(1, max(X)+1):
    x_sum=0
    for x in X:
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
ans = float("inf")
for p in range(1, max(X)+1):
   
    for x in X:
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

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

for p in range(1, max(X)+1):
    x_sum=0
    for x in X:
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
for p in range(1, max(X)):
    x_sum=0
    for x in X:
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
for P in range(1, max(X)):
    Distance = list(map(lambda x: (x-P)**2), X)
    Total_Distance = sum(Distance)
Total_Distance_List = list(Total_Distance)
print(min(Total_Distance_List))

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
for p in range(1, max(X)):
    for x in X:
        x_sum=0
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
X = list(map(int, input().split()))
for p in range(1, max(X)):
    for x in X:
        x_sum=0
        x_sum+=(x-p)**2
    ans = min(ans, x_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
N = input()
People = list(map(int, input().split()))
for P in range(1, max(People)):
    Distance = list(map(lambda x: (x-P)**2), People)
    Total_Distance = sum(Distance)
Total_Distance_List = list(Total_Distance)
print(min(Total_Distance_List))
Problem p02713 (python)

Fixed submission:
def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
  r = a % b
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b
 
l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(i3,z)
      s+=z2
print (s)

Buggy submission (verdict: Runtime Error):
def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
    r = a % b
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b
 
l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(z,i3)
      s+=z2
print (s)

Buggy submission (verdict: Runtime Error):
def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
   r = a % b;
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b
 
l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(z,i3)
      s+=z2
print (s)

Buggy submission (verdict: Runtime Error):
def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
   r = a % b;
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b

l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(z,i3)
      s+=z2
print (s)
Problem p02786 (python)

Fixed submission:
h = int(input())

i = 0
while True:
    if 2**i > h:
        break
    i += 1
 
print(2**i -1)

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

print(2 * h + 1)
Problem p02988 (python)

Fixed submission:
ss = input()
s = int(ss)
nums = list(map(int,input().split()))
count = 0
for val in range(s -2):
    if nums[val] > nums[val + 1] > nums[val + 2] or nums[val] < nums[val + 1] < nums[val + 2]:
        count += 1
        
print(count)

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

nums = input().split()
type(nums)
type(nums[0])

count = 0
for val in range(s -2):
    if list[val] > list[val + 1] > list[val + 1] or list [val] < list[val + 1] < list[val + 2]:
        count += 1
        
print(count)

Buggy submission (verdict: Runtime Error):
s = input()
all[20]

for val int range(s):
    all[val] = input()
    
count = 0
for val in range(s - 2)
    if all[val] < all[val + 1] and all[val + 1] < all[val + 2]
        count += 1
Problem p02718 (python)

Fixed submission:
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes = sum(A)
threshold = total_votes * (1 / (4 * M))

chooseable = 0

for a in A:
  if a >= threshold:
    chooseable += 1
    if chooseable >= M:
      print("Yes")
      sys.exit(0)

print("No")

Buggy submission (verdict: Runtime Error):
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))

total_votes = sum(A)
threshold = total_votes * (1 / (4 * M))

chooseable = 0

for a in A:
  if a >= threshold:
    chooseable += 1
    if chooseable >= M:
      print("Yes")
      sys.exit(1)

print("No")
Problem p02971 (python)

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

A_max = max(A)
A_second = A_max

if A.count(A_max) == 1:
  AA = []
  for a in A:
    if a != A_max:
      AA.append(a)
  A_second = max(AA)

for i in range(len(A)):
  if A[i] == A_max:
    print(A_second)
  else:
    print(A_max)

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

A_max = max(A)
AA = []
for a in A:
  if a != A_max:
    AA.append(a)
A_second = max(AA)

for i in range(len(A)):
  if A[i] == A_max:
    print(A_second)
  else:
    print(A_max)
Problem p02982 (python)

Fixed submission:
import math
import itertools

N, D = map(int, input().split())

X = [[0]*(D+1)]*(N+1)

for n in range(N):
    X[n] = list(map(int, input().split()))

def distance(x, y):
    dis = 0
    for d in range(D):
        dis += abs(x[d] - y[d]) ** 2
    
    return math.sqrt(dis).is_integer()
    
distance(X[1], X[2])

count = 0

for c in itertools.combinations(list(range(N)), 2):
    if distance(X[c[0]], X[c[1]]):
        count += 1
        
print(count)

Buggy submission (verdict: Runtime Error):
import math
import itertools

N, D = map(int, input().split())

X = [[0]*D+1]*N+1

for n in range(N):
    X[n] = list(map(int, input().split()))

def distance(x, y):
    dis = 0
    for d in range(D):
        dis += abs(x[d] - y[d]) ** 2
    
    return math.sqrt(dis).is_integer()
    
distance(X[1], X[2])

count = 0

for c in itertools.combinations(list(range(N)), 2):
    if distance(X[c[0]], X[c[1]]):
        count += 1
        
print(count)

Buggy submission (verdict: Runtime Error):
import math
import itertools

N, D = map(int, input().split())

X = [[0]*D]*N

for n in range(N):
    X[n] = list(map(int, input().split()))
    
#print(X)

def distance(x, y):
    dis = 0
    for d in range(D):
        dis += abs(x[d] - y[d]) ** 2
    
    #print(math.sqrt(dis))
    return math.sqrt(dis).is_integer()
    
distance(X[1], X[2])

#print(list(range(N)))

count = 0

for c in itertools.combinations(list(range(N)), 2):
    #print(c)
    if distance(X[c[0]], X[c[1]]):
        count += 1
        
print(count)
Problem p02983 (python)

Fixed submission:
import itertools

L, R = map(int, input().split())

R = min(R, L+2019)

mods = []

for c in list(itertools.combinations(list(range(L, R+1)),2)):
    mods.append((c[0]*c[1]) % 2019)

print(min(mods))

Buggy submission (verdict: Runtime Error):
import math
import itertools

L, R = map(int, input().split())

mods = []

for c in itertools.combinations(range(L, R+1), 2):
    # print(c)
    mods.append((c[0]*c[1]) % 2019)
    
print(min(mods))
Problem p02995 (python)

Fixed submission:

import math
import fractions

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

def lcm(a, b):
  return (a * b) // fractions.gcd(a, b)

# CとDの最小公倍数で割り切れる数
lcm = lcm(C, D)

ans = B-A+1 - (B//C-(A-1)//C) - (B//D-(A-1)//D) + (B//(lcm)-(A-1)//(lcm))

print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

# Cで割り切れる数
div_c_min = math.ceil(A/C)
div_c_max = math.floor(B/C)
div_c_num = div_c_max - div_c_min + 1
#print(div_c_min, div_c_max)
#print(div_c_num)

# Dで割り切れる数
div_d_min = math.ceil(A/D)
div_d_max = math.floor(B/D)
div_d_num = div_d_max - div_d_min + 1
#print(div_d_min, div_d_max)
#print(div_d_num)

# 最小公倍数
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

# CとDの公倍数で割り切れる数
div_cd_min = math.ceil(A / lcm(C, D))
div_cd_max = math.floor(B / lcm(C, D))
div_cd_num = div_cd_max - div_cd_min + 1
#print(div_cd_min, div_cd_max)
#print(div_cd_num)

numAtoB = B - A + 1
print(numAtoB - (div_c_num + div_d_num - div_cd_num))
Problem p03046 (python)

Fixed submission:
n, k = map(int, raw_input().strip().split())

if k == 0:
    sz = 1 << n
    sz -= 1
    out = [' '.join([str(i), str(i)]) for i in xrange(sz + 1)]
    print ' '.join(out)
    exit()

m = 1 << n
if k >= m:
    print -1
    exit()

if n < 2:
    print -1
    exit()

l = []
for i in xrange(m):
    if i == k: continue
    l.append(i)

l.append(k)
for i in xrange(m - 1, -1, -1):
    if i == k: continue
    l.append(i)
l.append(k)

print ' '.join(map(str, l))

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

if k == 0:
    sz = 1 << n
    sz -= 1
    out = [' '.join([str(i), str(i)]) for i in xrange(sz + 1)]
    print ' '.join(out)

elif k == 1:
    if m == 2:
        print 0, 1, 0, 2, 3, 1, 3, 2
    else:
        print -1
else:
    print -1
Problem p03080 (python)

Fixed submission:
n = input()
s = raw_input().strip()
r = b = 0
for i in xrange(n):
  if s[i] == 'R': r += 1
  else: b += 1
     
if r > b: print "Yes"
else: print "No"

Buggy submission (verdict: Runtime Error):
n = input()
s = raw_input().strip()
r = 0
for i in xrange(n):
  if s[i] == 'R': r += 1
  else: b += 1

if r > b: print "Yes"
else: print "No"
Problem p03166 (python)

Fixed submission:
from sys import stdin, setrecursionlimit as lim

lim(100001)

n, m = map(int, raw_input().strip().split())
inp = stdin.readlines()

g1 = [[] for i in xrange(n + 1)]
g2 = [[] for i in xrange(n + 1)]
ans1 = [0 for i in xrange(n + 1)]
ans2 = [0 for i in xrange(n + 1)]

for line in inp:
    u, v = map(int, line.strip().split())
    g1[u].append(v)
    g2[v].append(u)

def dfs1(u):
    if ans1[u] != 0: return ans1[u]
    ret = 0
    for v in g1[u]:
        if ans1[v] != 0: ret = max(ret, ans1[v])
        else: ret = max(ret, dfs1(v))
    ret += 1
    ans1[u] = ret
    return ans1[u]

def dfs2(u):
    if ans2[u] != 0: return ans2[u]
    ret = 0
    for v in g2[u]:
        if ans2[v] != 0: ret = max(ret, ans2[v])
        else: ret = max(ret, dfs2(v))
    ret += 1
    ans2[u] = ret
    return ans2[u]

ans = 0
for i in xrange(1, n + 1):
    if ans1[i] == 0: ans = max(ans, dfs1(i))
for i in xrange(1, n + 1):
    if ans2[i] == 0: ans = max(ans, dfs2(i))

print ans - 1

Buggy submission (verdict: Runtime Error):
from sys import stdin, setrecursionlimit as lim

lim(100001)

n, m = map(int, raw_input().strip().split())
inp = stdin.readlines()

g1 = ([] for i in xrange(n + 1))
g2 = ([] for i in xrange(n + 1))
ans1 = [0 for i in xrange(n + 1)]
ans2 = [0 for i in xrange(n + 1)]

for line in inp:
    u, v = map(int, line.strip().split())
    g1[u].append(v)
    g2[v].append(u)

def dfs1(u):
    if ans1[u] != 0: return ans1[u]
    ret = 0
    for v in g1[u]:
        if ans1[v] != 0: ret = max(ret, ans1[v])
        else: ret = max(ret, dfs1(v))
    ret += 1
    ans1[u] = ret
    return ans1[u]

def dfs2(u):
    if ans2[u] != 0: return ans2[u]
    ret = 0
    for v in g2[u]:
        if ans2[v] != 0: ret = max(ret, ans2[v])
        else: ret = max(ret, dfs2(v))
    ret += 1
    ans2[u] = ret
    return ans2[u]

ans = 0
for i in xrange(1, n + 1):
    if ans1[i] == 0: ans = max(ans, dfs1(i))
for i in xrange(1, n + 1):
    if ans2[i] == 0: ans = max(ans, dfs2(i))

print ans - 1
Problem p03240 (python)

Fixed submission:
n = input()
l = []
isz = 0
for i in xrange(n):
    x, y, h = map(int, raw_input().strip().split())
    if h == 0: isz += 1
    l.append([x, y, h])

assert isz != n

ans = [0,0,0]

for cx in xrange(101):
    for cy in xrange(101):
        H = 0
        zH = int(1e18)
        poss = True
        for xyh in l:
            x, y, h = xyh
            tx = abs(cx - x) + abs(cy - y)
            if h != 0:
                nH = tx + h
                if H != 0 and nH != H:
                    poss = False
                    break
                elif H == 0: H = nH
            elif h == 0:
                zH = min(zH, tx)

        if poss:
            if H > zH: poss = False
             
        if poss:
            ans = [cx, cy, H]
            break
        
    if poss: break
    
if ans != [0, 0, 0]:
    check = True
    for xyh in l:
        x, y, h = xyh
        tx = abs(cx - x) + abs(cy - y)
        assert h == max(ans[2] - tx, 0)

print ans[0], ans[1], ans[2]

Buggy submission (verdict: Runtime Error):
n = input()
l = []
isz = 0
for i in xrange(n):
    x, y, h = map(int, raw_input().strip().split())
    if h == 0: isz += 1
    l.append([x, y, h])

assert isz != n

ans = [0,0,0]

for cx in xrange(101):
    for cy in xrange(101):
        H = 0
        zH = int(1e18)
        poss = True
        for xyh in l:
            x, y, h = xyh
            tx = abs(cx - x) + abs(cy - y)
            if h != 0:
                nH = tx + h
                if H != 0 and nH != H:
                    poss = False
                    break
                elif H == 0: H = nH
            elif h == 0:
                zH = min(zH, tx + h)
                
        if poss:
            ans = [cx, cy, H]
            break
        
    if poss: break
    
if ans != [0, 0, 0]:
    check = True
    for xyh in l:
        x, y, h = xyh
        tx = abs(cx - x) + abs(cy - y)
        assert h == max(ans[2] - tx, 0)
 
print ans[0], ans[1], ans[2]
Problem p02993 (python)

Fixed submission:
s = list(input())

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')

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

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3] or s[3] == s[4]:
    print('Bad')
else:
    print('Good')
Problem p02995 (python)

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

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

lcm = c*d//gcd(c,d)

b_num = b - b//c - b//d + b//lcm
a_num = (a-1) - (a-1)//c - (a-1)//d + (a-1)//lcm


ans = b_num - a_num

print(ans)

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

lcm = c*d//math.gcd(c,d)

b_num = b - b//c - b//d + b//lcm
a_num = a - a//c - a//d + a//lcm

ans = b_num - a_num + 1

print(int(ans))
Problem p03001 (python)

Fixed submission:
w, h, x, y= map(int,input().split())

f = 0
s = h*w/2
if x == w/2 and y == h/2:
    f = 1

print(s,f)

Buggy submission (verdict: Runtime Error):
w, h, x, y= map(int,input().split())

f = 0
if x <= w/2 and y <= h/2:
    if y/x == h/w and x == w/2 and y == h/2:
        s = h*w/2
        f = 1
    elif y/x == h/w and (x < w/2 or y < h/2):
        s = h*w/2
    else:
        s1 = x*h
        s2 = w*y
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x > w/2 and y <= h/2:
    if (h-y)/x == h/w:
        s = h*w/2
    else:
        s1 = (w-x)*h
        s2 = w*y
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x > w/2 and y > h/2:
    if y/x == h/w:
        s = h*w/2
    else:
        s1 = (w-x)*h
        s2 = w*(h-y)
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x <= w/2 and y > h/2:
    if (h-y)/x == h/w:
        s = h*w/2
    else:
        s1 = x*h
        s2 = w*(h-y)
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)

Buggy submission (verdict: Runtime Error):
w, h, x, y= map(int,input().split())

f = 0
if x <= w/2 and y <= h/2:
    if y/x == h/w and x == w/2 and y == h/2:
        s = h*w/2
        f = 1
    elif y/x == h/w:
        s = h*w/2
    else:
        s1 = x*h
        s2 = w*y
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x > w/2 and y <= h/2:
    if (h-y)/x == h/w:
        s = h*w/2
    else:
        s1 = (w-x)*h
        s2 = w*y
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x > w/2 and y > h/2:
    if y/x == h/w:
        s = h*w/2
    else:
        s1 = (w-x)*h
        s2 = w*(h-y)
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
elif x <= w/2 and y > h/2:
    if (h-y)/x == h/w:
        s = h*w/2
    else:
        s1 = x*h
        s2 = w*(h-y)
        s = max(s1,s2)
        if s1 == s2:
            f=1
    print(s,f)
Problem p03062 (python)

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

time = 0
for i in range(n):
    if a[i] < 0:
        time += 1
        a[i] = -a[i]

sum = 0
for i in range(n):
    sum += a[i]

a.sort()

if time % 2 == 0:
    print(sum)
else:
    print(sum - a[0] * 2)

Buggy submission (verdict: Runtime Error):
import math

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

a.sort()

if n == 2:
    print(a[1])
elif n == 3:
    gcd1 = math.gcd(a[0],a[1])
    gcd2 = math.gcd(a[1],a[2])
    gcd3 = math.gcd(a[0],a[2])
    ans = [gcd1, gcd2, gcd3]
    ans.sort()

    print(ans[-1])

else:
    gcd1 = math.gcd(a[0],a[1])
    gcd2 = math.gcd(a[1],a[2])
    gcd3 = math.gcd(a[0],a[2])

    for i in range(3,n):
        if math.gcd(gcd1, a[i]) < gcd1:
            gcd1 = math.gcd(gcd1, a[i])

    for i in range(3,n):
        if math.gcd(gcd2, a[i]) < gcd2:
            gcd2 = math.gcd(gcd2, a[i])

    for i in range(3,n):
        if math.gcd(gcd3, a[i]) < gcd3:
            gcd3 = math.gcd(gcd3, a[i])

    ans = [gcd1, gcd2, gcd3]
    ans.sort()

    print(ans[-1])
Problem p03071 (python)

Fixed submission:
a,b = map(int,input().split())
if a-b >= 2:
  print(2*a-1)
elif b-a >= 2:
  print(2*b-1)
else:
  print(a+b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a-b >= 2:
  print(2a-1)
elif b-a >= 2:
  print(2b-1)
else:
  print(a+b)
Problem p03085 (python)

Fixed submission:
b = input()
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "C":
  print("G")
elif b == "G":
  print("C")

Buggy submission (verdict: Runtime Error):
N, Q = map(int,input().split())
S = input()

count_list = [0]*(N+1)

for i in range(N):
    if S[i:i+2] == 'AC':
        count_list[i+1] = count_list[i] + 1
    else:
        count_list[i+1] = count_list[i]

for i in range(Q):
    l, r = map(int,input().split())
    print(count_list[r-1] - count_list[l-1])
Problem p03089 (python)

Fixed submission:
N = int(input())
b_list = list(map(int,input().split()))
answer_list = []
check = 0

for i in range(N):
    if b_list[i] > i+1:
        print(-1)
        check = 1
        break

if check == 0:
    for i in range(N):     
        for j in range(N-i, 0, -1):
            
            if b_list[j-1] == j:
                answer_list.append(b_list[j-1])
                b_list.pop(j-1)
                
                break

    answer_list.reverse()


    for i in range(N):
        print(answer_list[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
b_list = list(map(int,input().split()))
answer_list = []

for i in range(N):
    if b_list[i] > i+1:
        print(-1)
        break


    
    for j in range(N-i, 0, -1):
        
        if b_list[j-1] == j:
            answer_list.append(b_list[j-1])
            b_list.pop(j-1)
            
            break

answer_list.reverse()


for i in range(N):
    print(answer_list[i])

Buggy submission (verdict: Runtime Error):
N = int(input())
b_list = list(map(int,input().split()))
answer_list = []

for i in range(N):
    if b_list[i] > i+1:
        print(-1)
        break

for i in range(N): 
    
    for j in range(N-i, 0, -1):
        
        if b_list[j-1] == j:
            answer_list.append(b_list[j-1])
            b_list.pop(j-1)
            
            break

answer_list.reverse()


for i in range(N):
    print(answer_list[i])
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())

print(H*W - W*h - H*w + h*w)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = mao(int, input().split())

print(W*h + H*w -(h+w-1))
Problem p03106 (python)

Fixed submission:
a, b, k = map(int,input().split())
List = []

for i in range(1,101,1):
    if a % i == 0 and b % i == 0:
        List.append(i)

print(List[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
List = []

for i in range(1,101,1):
    if a % i == 0 and b % i == 0:
        List.append(i)

print(List[k-1])
Problem p02778 (python)

Fixed submission:
S = input()
print(''.join(['x' for x in S]))

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)
Problem p02812 (python)

Fixed submission:
N = int(input())
S = input()
print(S.count("ABC"))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
print(S.count("ABC"))