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

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 6)


def dfs(x, y, matrix, visited, isWhite):
    global black, white
    dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]
    visited[y][x] = True
    w = len(matrix[0])
    h = len(matrix)

    for dx, dy in dxy:
        nx = x + dx
        ny = y + dy

        if nx < 0 or w <= nx or ny < 0 or h <= ny:
            continue

        if visited[ny][nx] is True:
            continue

        if (matrix[ny][nx] == "#" and isWhite is False) or (
            matrix[ny][nx] == "." and isWhite is True
        ):
            continue

        if matrix[ny][nx] == "#":
            black += 1
        else:
            white += 1

        isWhite = not isWhite
        dfs(nx, ny, matrix, visited, isWhite)
        isWhite = not isWhite

    return


h, w = map(int, input().split())
matrix = [""] * h
for i in range(h):
    matrix[i] = input()

ans = 0
visited = [[False] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if matrix[i][j] == "#" and visited[i][j] is False:
            black = 1
            white = 0
            dfs(j, i, matrix, visited, False)
            ans += black * white

print(ans)

Buggy submission (verdict: Runtime Error):
def dfs(x, y, matrix, visited, isWhite):
    global black, white
    dxy = [[1, 0], [-1, 0], [0, -1], [0, 1]]
    visited[y][x] = True
    w = len(matrix[0])
    h = len(matrix)

    for dx, dy in dxy:
        nx = x + dx
        ny = y + dy

        if nx < 0 or w <= nx or ny < 0 or h <= ny:
            continue

        if visited[ny][nx] is True:
            continue

        if (matrix[ny][nx] == "#" and isWhite is False) or (
            matrix[ny][nx] == "." and isWhite is True
        ):
            continue

        if matrix[ny][nx] == "#":
            black += 1
        else:
            white += 1

        isWhite = not isWhite
        dfs(nx, ny, matrix, visited, isWhite)
        isWhite = not isWhite

    return


h, w = map(int, input().split())
matrix = [""] * h
for i in range(h):
    matrix[i] = input()

ans = 0
visited = [[False] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if matrix[i][j] == "#" and visited[i][j] is False:
            black = 1
            white = 0
            dfs(j, i, matrix, visited, False)
            ans += black * white

print(ans)
Problem p03240 (python)

Fixed submission:
n = int(input())
coord = []

for i in range(n):
    x, y, h = map(int, input().split())
    coord.append([h, x, y])
    if h > 0:
        x0, y0, h0 = x, y, h

flag = False


for cx in range(0, 101):
    for cy in range(0, 101):
        flag = True

        H = h0 + abs(x0 - cx) + abs(y0 - cy)

        for i in range(n):
            if coord[i][0] != max(H - abs(coord[i][1] - cx) - abs(coord[i][2] - cy), 0):
                flag = False
                break

        if flag is True:
            res_x = cx
            res_y = cy
            res_h = H

print(res_x, res_y, res_h)

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

for i in range(n):
    x, y, h = map(int, input().split())
    coord.append([h, x, y])

flag = False

for cx in range(0, 101):
    for cy in range(0, 101):
        flag = True

        H = coord[0][0] + abs(coord[0][1] - cx) + abs(coord[0][2] - cy)

        for i in range(1, n):
            if coord[i][0] > 0 and H != coord[i][0] + abs(coord[i][1] - cx) + abs(
                coord[i][2] - cy
            ):
                flag = False

            if coord[i][0] == 0 and H > abs(coord[i][1] - cx) + abs(coord[i][2] - cy):
                flag = False

        if flag is True:
            res_x = cx
            res_y = cy
            res_h = H

print(res_x, res_y, res_h)
Problem p03268 (python)

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

cnt = [0] * (n + 1)

for i in range(1, n + 1):
    cnt[i % k] += 1

if k % 2 == 0:
    ans = 0
    ans += cnt[0] * cnt[0] * cnt[0]
    if k // 2 <= n:
        ans += cnt[k // 2] * cnt[k // 2] * cnt[k // 2]
    print(ans)
else:
    print(cnt[0] * cnt[0] * cnt[0])

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

cnt = [0] * (n + 1)

for i in range(1, n + 1):
    cnt[i % k] += 1

if k % 2 == 0:
    ans = 0
    ans += cnt[0] * cnt[0] * cnt[0]
    ans += cnt[k // 2] * cnt[k // 2] * cnt[k // 2]
    print(ans)
else:
    print(cnt[0] * cnt[0] * cnt[0])

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

cnt = [0] * (n)

for i in range(1, n + 1):
    cnt[i % k] += 1

if k % 2 == 0:
    ans = 0
    ans += cnt[0] * cnt[0] * cnt[0]
    ans += cnt[k // 2] * cnt[k // 2] * cnt[k // 2]
    print(ans)
else:
    print(cnt[0] * cnt[0] * cnt[0])
Problem p03471 (python)

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

found = False

for i in range(0, n + 1):
    for j in range(0, n + 1 - i):
        sum = 10000 * i + 5000 * j + 1000 * (n - i - j)
        if sum == y:
            found = True
            print(str(i) + " " + str(j) + " " + str(n - i - j))
            break
    if found:
        break

if found is False:
    print("-1 -1 -1")

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

found = False

for i in range(0, n + 1):
    for j in range(0, n + 1 - i):
        sum = 10000 * i + 5000 * j + 1000 * (n - i - j)
        if sum == y:
            found = True
            print(str(i) + " " + str(j) + " " + str(n - i - j))

if !found:
    print("-1 -1 -1")
Problem p03651 (python)

Fixed submission:
def gcd(a, b):
    return gcd(b, a % b) if b > 0 else a


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

m = max(a)

g = a[0]

for i in range(n):
    g = gcd(g, a[i])

if k > m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    return gcd(b, a % b) if b > 0 else a


n, k = map(int, input().split())
a = list(map(int, input().split())
        
m = max(a)
         
g = a[0]
         
for i in range(n):
    g = gcd(g, a[i])

if k > m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
from fractions import gcd

n,k = map(int, input().split())
a = list(map(int, input().split())
         
m = max(a)
         
g = a[0]
         
for i in range(n):
    g = gcd(g, a[i])

if k>m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
Problem p03864 (python)

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

cnt, a[0] = sum(a), min(a[0], x)
for i in range(1, n):
    if a[i - 1] + a[i] > x:
        a[i] = x - a[i - 1]
print(cnt - sum(a))

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

a = list(map(int, input().split())
before = sum(a)

for i in range(n-1):
	while a[i] + a[i+1] > x:
		a[i+1] -= 1
		
after = sum(a)

print(after - before)
Problem p03994 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    s = rl().rstrip()
    K = int(rl())
    
    ans = []
    for si in s:
        if si == 'a':
            ans.append('a')
            continue
        cnt = ord('z') - ord(si) + 1
        if cnt <= K:
            ans.append('a')
            K -= cnt
        else:
            ans.append(si)
    
    ans[-1] = chr(ord('a') + (ord(ans[-1]) - ord('a') + K % 26) % 26)
    print(''.join(ans))


if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline()[:-1]

alphabet = "abcdefghijklmnopqrstuvwxyz"
a_len = len(alphabet)
table = {c: idx for idx, c in enumerate(alphabet)}

s = input()
k = int(input())

ans = ""
for i in range(len(s[:-1])):
    gap = a_len - table[s[i]]
    if gap <= k:
        ans += "a"
        k -= gap
    elif k == 0:
        ans += s[i:-1]
    else:
        ans += s[i]

ans += alphabet[(table[s[-1]] + k) % a_len]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

alphabet = "abcdefghijklmnopqrstuvwxyz"
a_len = len(alphabet)
table = {c: idx for idx, c in enumerate(alphabet)}

rl = sys.stdin.readline
s = rl().rstrip("\n")
k = int(rl())

ans = ""
for i in range(len(s[:-1])):
    gap = a_len - table[s[i]]
    if gap <= k:
        ans += "a"
        k -= gap
    elif k == 0:
        ans += s[i:-1]
    else:
        ans += s[i]

ans += alphabet[(table[s[-1]] + k) % a_len]
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

alphabet = "abcdefghijklmnopqrstuvwxyz"
a_len = len(alphabet)
table = {c: idx for idx, c in enumerate(alphabet)}

rl = sys.stdin.readline
s = rl().rstrip()
k = int(rl())

ans = ""
for i in range(len(s[:-1])):
    gap = a_len - table[s[i]]
    if gap <= k:
        ans += "a"
        k -= gap
    elif k == 0:
        ans += s[i:-1]
    else:
        ans += s[i]

ans += alphabet[(table[s[-1]] + k) % a_len]
print(ans)
Problem p02683 (python)

Fixed submission:
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)
ans=[]
q=len(d)
for i in range(2**q):
    score=[0]*b
    total=0
    n=0
    for j in range(q):
        if ((i>>j)&1):
            for m in range(b):
                score[m]+=d[j][m+1]
            total+=d[j][0]
    for mm in range(b):
        if score[mm]>=c:
            n+=1
    if n==b:
        ans.append(total)

if ans==[]:
    print(-1)
else:
    print(min(ans))

Buggy submission (verdict: Runtime Error):
def cloth(a):
    n=len(a)
    r=[0]*3
    for i in range(n):
        r[0]+=a[i][0]
        r[1]+=a[i][1]
        r[2]+=a[i][2]
    return r
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)

m=[]
q=[]

for i in range(2**a):
    score=[]
    total=0
    for j in range(a):
        if ((i>>j)&1):
            score.append(d[j][1:b+1])
            total+=d[j][0]
    m.append([score,total])

large=len(m)
決勝=[]
n=0
q=0
while True:
    q=len(m[n][0])
    if q==a:
        break
    r=cloth(m[n][0])
    n+=1
    if r[0]<c or r[1]<c or r[2]<c:
        continue
    else:
        決勝.append(m[n][1])

u=cloth(m[-1][0])
if len(決勝)==0 and len([i for i in u if i>=c])==3:
    print(m[-1][1])

elif len(決勝)==0:
    print(-1)
else:
    print(min(決勝))

Buggy submission (verdict: Runtime Error):
def cloth(a):
    n=len(a)
    r=[0]*3
    for i in range(n):
        r[0]+=a[i][0]
        r[1]+=a[i][1]
        r[2]+=a[i][2]
    return r
a,b,c=map(int,input().split())
d=[]
for i in range(a):
    n=list(map(int,input().split()))
    d.append(n)

m=[]
q=[]

for i in range(2**a):
    score=[]
    total=0
    for j in range(a):
        if ((i>>j)&1):
            score.append(d[j][1:b+1])
            total+=d[j][0]
    m.append([score,total])

large=len(m)
決勝=[]
n=0
q=0
while True:
    q=len(m[n][0])
    if q==a:
        break
    r=cloth(m[n][0])
    n+=1
    if r[0]<c or r[1]<c or r[2]<c:
        continue
    else:
        決勝.append(m[n-1][1])

u=cloth(m[-1][0])
if len(決勝)==0 and len([i for i in u if i>=c])==3:
    print(m[-1][1])

elif len(決勝)==0:
    print(-1)
else:
    print(min(決勝))
Problem p02700 (python)

Fixed submission:
import math
a,b,c,d=map(int,input().split())
e=math.ceil(c/b)
f=math.ceil(a/d)
if e>f:
  print('No')
elif e==f:
  print('Yes')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
e=0
f=0
while a-d>=0:
    g=a-d
    e+=1
    a=g
while c-b>=0:
    h=c-b
    f+=1
    c=h
if g<h:
    print('Yes')
elif f==0:
    print('Yes')
elif e==f:
    print('No')
else:
    print('No')
Problem p02713 (python)

Fixed submission:
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=math.gcd(i,j)
        for k in l3:
            count+=math.gcd(te,k)

print(count)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=gcd(i,j)
        for k in l3:
            count+=(te,k)

print(count)
Problem p02731 (python)

Fixed submission:
a=int(input())
print((a/3)**3)

Buggy submission (verdict: Runtime Error):
a=int(input())
b,c,d=a/3
print(a*b*c)
Problem p02741 (python)

Fixed submission:
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())-1])

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=len([i for i in range(1,a+1) if i%2==0])
d=len([i for i in range(1,a+1) if i%2!=0])
e=len([i for i in range(1,b+1) if i%2==0])
f=len([i for i in range(1,b+1) if i%2!=0])
if a%2==0 and b%2==0:
    print((a*b)//2)
elif a%2==0 and b%2!=0:
    print((a//2)*b)
elif a%2!=0 and b==0:
    print((b//2)*a)
else:
    print(d*f+c*e)
Problem p02765 (python)

Fixed submission:
a,b=map(int,input().split())
if a<10:
  print(b+(100*(10-a)))
else:
  print(b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=0
if a>b:
while a//b>=b:  
  a=a//b
  c+=1
print(c+2)
else:
    print(len(a))
Problem p02772 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
c=[i for i in b if i%2==0]
d=len(c)
e=[j for j in c if j%3==0 or j%5==0]
f=len(e)
if d==f:
       print('APPROVED')
else:
       print('DENIED')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split())
c=[i for i in b if i%2==0]
d=len(c)
e=[j for j in c if i%3==0 or i%5==0]
f=len(e)
if d==f:
       print('APPROVED')
else:
       print('DENIED')
Problem p02780 (python)

Fixed submission:
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

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

if a==b:
    print((sum(c)+a)/2)
    exit()

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)

m=[]
for i in range(0,a-b):
    m.append(n[i+b]-n[i])


print(max(m))

Buggy submission (verdict: Runtime Error):
def cumsum(xs):
    result = [xs[0]]
    for x in xs[1:]:
        result.append(result[-1] + x)
    return result

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

d=[]

c=[(i+1)/2 for i in c]
n=cumsum(c)
m=[]
for i in range(a-b):
    m.append(n[i+b]-n[i])


print(max(m))

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

d=[]
for i in range(a-b):
    d.append(sum(c[i:i+b]))

n=max(d)
print((n+b)/2)
Problem p02784 (python)

Fixed submission:
a,b=map(int,input().split())
n=list(map(int,input().split()))
if a<=sum(n):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[int(input()) for i in reange(b+1)]
if a<=sum(n):
  print('Yes')
else:
  print('No')
Problem p02801 (python)

Fixed submission:
a=input()
n=[chr(i) for i in range(97, 97+26)]
# [chr(i) for i in range(ord('a'), ord('z')+1)]
print(n[1+n.index(a)])

Buggy submission (verdict: Runtime Error):
a=input()
n=[chr(i) for i in range(97, 97+26)]
# [chr(i) for i in range(ord('a'), ord('z')+1)]
print(n[1+n.count(a)]
Problem p02921 (python)

Fixed submission:
a=list(input())
b=list(input())
c=0
for i in range(3):
  if a[i]==b[i]:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a=list(input())
b=list(input())
print(len(list(set(a)a&set(b))))
Problem p02934 (python)

Fixed submission:
import math
from functools import reduce
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
a=int(input())
b=list(map(int,input().split()))
n=lcm_list(b)
m=0
for i in b:
    m+=n//i
print(n/m)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
print(b/a)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[a+b,a*b,a-b]
n.sorted()
print(n[-1])
Problem p02946 (python)

Fixed submission:
a,b=map(int,input().split())
c=list(range(b-(a-1),b+(a-1)+1))
d=' '.join(map(str,c))
print(d)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(' '.join(list(range(b-(a-1),b+(a+1)))))
Problem p02952 (python)

Fixed submission:
a=int(input())
b=0
for i in range(1,a+1):
  if len(str(i))%2==1:
    b+=1
print(b)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=0
for i in range(1,a+1):
  if len(i)%2==1:
    b+=1
print(b)
Problem p02958 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
c=sorted(b)
d=0
for i in range(a):
  if b[i]!=c[i]:
    d+=1
if d<=2:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=list(map(int,input().split()))
c=b.sorted()
d=0
for i in range(a):
  b[i]!=b[i]
  d+=1
if d<=2:
  print('YES')
else:
  print('NO')
Problem p02983 (python)

Fixed submission:
a,b=map(int,input().split())
if b-a>=2019:
    print(0)
    exit()
d=[]
for i in range(a,b+1):
    if i%2019==0:
        print(0)
        exit()
    for j in range(a,b+1):
        if i<j:
            d.append((i*j)%2019)
print(min(d))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
c=[]
for i in range(a,b+1):
  for j in range(i):
    d=(i*j)%2019
    c.append(d)
print(min(d))
Problem p02993 (python)

Fixed submission:
a=list(input())
if a[0]==a[1] or a[1]==a[2] or a[2]==a[3]:
  print('Bad')
else:
  print('Good')

Buggy submission (verdict: Runtime Error):
a=list(input())
b=[]
for i in range(3):
  if a[i]==a[i+1]:
      b.append(0)
  else:
      b.append(1)
if b in 0:
    print('Bad')
else:
    print('Good')
Problem p03316 (python)

Fixed submission:
a=input()
b=int(a)
c=list(a)
c=[int(i) for i in c]
if b%(sum(c))==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
b=int(a)
c=list(a)
if b%(sum(c))==0:
  print('Yes')
else:
  print('No')
Problem p03352 (python)

Fixed submission:
a=int(input())
result=[]
for i in range(1,a+1):
    for j in range(2,a+1):
        if j>=10:
            continue
        if i**j<=a:
            result.append(i**j)
result.append(1)
print(max(result))

Buggy submission (verdict: Runtime Error):
a=int(input())
result=[]
for i in range(1,a+1):
    for j in range(2,a+1):
        if j>=10:
            continue
        if i**j<=a:
            result.append(i**j)
print(max(result))
Problem p03385 (python)

Fixed submission:
a=input()
if len(set(a))==3:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=list(input())
b=[a,b,c]
if sort(a)==b:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=list(input())
if sort(a)==[a,b,c]:
  print('Yes')
else:
  print('No')
Problem p03456 (python)

Fixed submission:
a,b=map(str,input().split())
n=int(a+b)
for i in range(0,1000):
    if i**2==n:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
n=int(a+b)
for i in range(0,110):
  if i**2==n:
    print('Yes')
	exit()
print('No')

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
n=int(a+b)
for i in range(0,110):
  if i**2==a:
    print('Yes')
   	exit()
print('No')
Problem p03469 (python)

Fixed submission:
a,b,c=map(str,input().split('/'))
a='2018'
print(a,b,c,sep='/')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,inpput().split('/'))
a=2018
print(a,'/',b,'/',c)
Problem p03477 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if a+b>c+d:
  print('Left')
elif (a+b)==(c+d):
  print('Balanced')
else:
  print('Right')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input())
if a+b>c+d:
  print('Right')
elif (a+b)==(c+d):
  print('Balanced')
else:
  print('Left')
Problem p03493 (python)

Fixed submission:
a=input()
print(a.count('1'))

Buggy submission (verdict: Runtime Error):
a=list(input())
print(a.index(1))
Problem p03545 (python)

Fixed submission:
a,b,c,d = input()
for i in range(2**3):
    ls = ["+","+","+"]
    for j in range(len(ls)):
        if (i >> j) & 1:
            ls[j] = "-"
    if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
        print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
        break

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

for i in range(2**3):
  e=['+','+','+']
  for j in range(len(e)):
    if (i<<j)&1:
      e[j]='-'
  if eval(a+ls[0]+b+ls[1]+c+ls[2]+d) == 7:
    print(a+ls[0]+b+ls[1]+c+ls[2]+d+"=7")
	break
Problem p03547 (python)

Fixed submission:
c,d=map(str,input().split())
n=sorted([c,d])
a=n.index(c)
b=n.index(d)
if a>b:
  print('>')
elif a==b:
  print('=')
else:
  print('<')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
  print('>')
elif a==b:
  print('=')
else:
  print('<')

Buggy submission (verdict: Runtime Error):
n=['A', 'B', 'C', 'D', 'E', 'F']
a,b=map(int,input().split())
c,d=n.index(a),n.index(b)
if c>d:
  print('>')
elif c<d:
  print('<')
else:
  print('=')
Problem p03555 (python)

Fixed submission:
a=list(input())
b=list(input())

if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print('YES')
else:
  print('NO')
Problem p03573 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a-b==0:
  print(c)
elif a-c==0:
  print(b)
elif b-c==0:
  print(a)

Buggy submission (verdict: Runtime Error):
import Collections
a,b,c=map(int,input().split())
n=[a,b,c]
d,e=zip(*n.most_common())
d=list(d)
print(d[-1])
Problem p03606 (python)

Fixed submission:
a=int(input())
b=[]
for _ in range(a):
  b.append(list(map(int,input().split())))
ans=0
for i in range(a):
  ans+=b[i][1]-b[i][0]+1
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[]
for _ in range(a):
  b.append(list(map(int,input().split())))
ans=0
for i in range(a):
  ans+=n[i][1]-n[i][0]+1
print(ans)
Problem p03610 (python)

Fixed submission:
a=input()
n=[]
for i in range(len(a)):
  if i%2==0:
    n.append(i)
ans=''
for i in n:
  ans=ans+a[i]
print(ans)

Buggy submission (verdict: Runtime Error):
a=input()
n=[]
for i in range(len(a)):
  if i%2==1:
    n.append(i)
ans=''
for i in n:
  ans+=i
print(ans)
Problem p03623 (python)

Fixed submission:
a,b,c=map(int,input().split())
if abs(a-b)<abs(a-c):
  print('A')
else:
  print('B')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if abs(a-b)<abs(a-c):
  prinnt('A')
else:
  print('B')
Problem p03711 (python)

Fixed submission:
a,b=map(int,input().split())
n=[1,3,5,7,8,10,12]
m=[4,6,9,11]
o=[2]
p=[n,m,o]
if (a in n and b in n) or (a in m and b in m) or (a in o and b in o):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
n=[1,3,5,7,8,10,12]
m=[4,6,9,11]
o=[2]
p=[n,m,o]
if count(a)==count(b):
  print('Yes')
else:
  print('No')
Problem p03737 (python)

Fixed submission:
a,b,c=map(str,input().split())
d=str(a[0]+b[0]+c[0])
print(d.upper())

Buggy submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
print(a[0],b[0],c[0],sep='',capitalize())
Problem p03759 (python)

Fixed submission:
a,b,c=map(int,input().split())
if b-a==c-b:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if b-c==c=b:
  print('YES')
else:
  print('NO')
Problem p03777 (python)

Fixed submission:
a,b=map(str,input().split())
if a==b:
  print('H')
else:
  print('D')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
  print('H')
else:
  print('D')
Problem p03844 (python)

Fixed submission:
a,b,c=map(str,input().split())
if b=='-':
  print(int(a)-int(c))
else:
  print(int(a)+int(c))

Buggy submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
if b=='-':
  print(int(a)-int(c))
else:
  print(int(a)+int(b))