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

Fixed submission:
from sys import stdin
def ch_max(dp_i, dp_i_1):
    if dp_i < dp_i_1:
        dp_i = dp_i_1
    return dp_i
def chmin(dp_i, dp_i_1):
    if dp_i > dp_i_1:
        dp_i = dp_i_1
    return dp_i
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

if n == 2:
    print(abs(h[0] - h[1]))
    exit()
dp = [float('inf')] * n
dp[0] = 0
dp[1] = abs(h[0] - h[1])
for i in range(n - 2):
    dp[i + 2] = chmin(dp[i + 2],dp[i + 1] + abs(h[i + 2] - h[i + 1]))
    dp[i + 2] = chmin(dp[i + 2],dp[i] + abs(h[i + 2] - h[i]))
print(dp[n - 1])

Buggy submission (verdict: Runtime Error):
from sys import stdin
def ch_max(dp_i, dp_i_1):
    if dp_i < dp_i_1:
        dp_i = dp_i_1
    return dp_i
def chmin(dp_i, dp_i_1):
    if dp_i > dp_i_1:
        dp_i = dp_i_1
    return dp_i
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

if n == 2:
    print(abs(h[0] - h[1]))
    exit()
dp = []
dp1[0] = 0
dp[1] = abs(h[0] - h[1])
for i in range(n - 2):
    dp[i + 2] = float('inf')
    dp[i + 2] = chmin(dp[i + 2],dp[i + 1] + abs(h[i + 2] - h[i + 1]))
    dp[i + 2] = chmin(dp[i + 2],dp[i] + abs(h[i + 2] - h[i]))
print(dp[n - 1])
Problem p03361 (python)

Fixed submission:
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    #matrix[i] = [0 if x == '.' else x for x in matrix[i]]
#print(matrix)
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            flag = 0
            for n in list([-1, 1]):
                i_n = i + n
                j_n = j + n
                if i_n >= 0 and i_n < h:
                    if matrix[i_n][j] == '#':
                        flag = 1
                        break
                if j_n >= 0 and j_n < w:
                    if matrix[i][j_n] == '#':
                        flag = 1
                        break
            if flag == 0:
                print('No')
                exit()
print('Yes')
#print(*matrix, sep = '\n')

Buggy submission (verdict: Runtime Error):
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    #matrix[i] = [0 if x == '.' else x for x in matrix[i]]
#print(matrix)
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            flag = 0
            for n in list([-1, 1]):
                i_n = i + n
                j_n = j + n
                if matrix[i_n][j] == '#' and i_n >= 0 and i_n < h:
                    flag = 1
                    break
                if matrix[i][j_n] == '#' and j_n >= 0 and j_n < w:
                    flag = 1
                    break
            if flag == 0:
                print('No')
                exit()
print('Yes')
#print(*matrix, sep = '\n')

Buggy submission (verdict: Runtime Error):
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    #matrix[i] = [0 if x == '.' else x for x in matrix[i]]
print(matrix)
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            flag = 0
            for n in list[-1, 1]:
                i_n = i + n
                j_m = j + m
                if matrix[i_n][j] == '#' and i_n >= 0 and i_n < h:
                    flag = 1
                    break
                if matrix[i][j_m] == '#' and j_m >= 0 and j_m < w:
                    flag = 1
                    break
            if flag == 0:
                print('No')
                exit()
print('Yes')
#print(*matrix, sep = '\n')
Problem p03449 (python)

Fixed submission:
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
msum = 0

for i in range(n):
  sum = 0
  for j in range(i + 1):
    sum += a1[j]
    #print(a1[j], end = '')
  for j in range(i, n):
    sum += a2[j]
    #print(a2[j], end = '')
  #print()
  #print(sum)
  if msum < sum:
    msum = sum
print(msum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a1 = map(int, input().split())
a2 = map(int, input().split())
msum = 0
for i in range(n):
  sum = 0
  for j in range(i + 1):
    sum += a1[j]
  for i in range(i, n):
    sum += a2[j]
  if msum < sum:
    msum = sum
print(msum)
Problem p03493 (python)

Fixed submission:
a, b, c = map(int, list(input()))
print(a+b+c)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(int(a) + int(b) + int(c))
Problem p03574 (python)

Fixed submission:
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    matrix[i] = [0 if x == '.' else x for x in matrix[i]]
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            for n in range(-1, 2):
                for m in range(-1, 2):
                    i_n = i + n
                    j_m = j + m
                    if h > i_n >= 0 and w > j_m >= 0 :
                    	if matrix[i_n][j_m] != '#':
                        	matrix[i_n][j_m] += 1
for i in range(h):
  for j in range(w):
  	print('{}'.format(matrix[i][j]), end = '')
  print('')

Buggy submission (verdict: Runtime Error):
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    matrix[i] = [0 if x == '.' else x for x in matrix[i]]
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            for n in range(-1, 2):
                for m in range(-1, 2):
                    i_n = i + n
                    j_m = j + m
                    if matrix[i_n][j_m] != '#' and i_n >= 0 and j_m >= 0:
                        matrix[i_n][j_m] += 1
for i in range(h):
  for j in range(w):
  	print('{}'.format(matrix[i][j]), end = '')
  print('')

Buggy submission (verdict: Runtime Error):
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    matrix[i] = [0 if x == '.' else x for x in matrix[i]]
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            for n in range(-1, 2):
                for m in range(-1, 2):
                    i_n = i + n
                    j_m = j + m
                    if matrix[i_n][j_m] != '#' and i_n >= 0 and j_m >= 0:
                        matrix[i_n][j_m] += 1

print(*matrix, sep = '\n')
Problem p03796 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input())
print(k * ((k - 1) ** (n - 1)))
Problem p03485 (python)

Fixed submission:
a,b = map(int, input().split())
c = -(-(a + b)//2)
print("{}".format(c))

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
for i in range(100):
    if bool(s[i:i+1]) == False:
        if t[i:i+1]:
            print("Yes")
            break
        else:
            print("No")
            break
    elif bool(t[i:i+1]) == False:
        print("No")
        break
    elif (s[i] < t[i]):
        print("Yes")
        break
    elif (s[i] > t[i]):
        print("No")
        break

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
for i in range(100):
    if bool(s[i:2]) == False:
        if t[i:2]:
            print("Yes")
            break
        else:
            print("No")
            break
    elif bool(t[i:2]) == False:
        print("No")
        break
    elif (s[i] < t[i]):
        print("Yes")
        break
    elif (s[i] > t[i]):
        print("No")
        break
Problem p03085 (python)

Fixed submission:
# coding: utf-8

l = (("A","T"),("G","C"))
i = input()
if i in l[0]:
    if i == l[0][0]:
        print(l[0][1])
    else: print(l[0][0])
else:
    if i == l[1][0]:
        print(l[1][1])
    else: print(l[1][0])

Buggy submission (verdict: Runtime Error):
l = (("A","T"),("G","C"))
i = inpit()
if i in l[0]:
  if i == l[0][0]:
    print(l[0][1])
  else: print(l[0][0])
else:
  if i == l[1][0]:
    print(l[1][1])
  else: print(l[1][0])
Problem p03105 (python)

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

if b//a >= c:
    print(c)
else:
    print(b//a)

Buggy submission (verdict: Runtime Error):

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    divisors.sort()
    return divisors


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

c_set = list(set(make_divisors(a))&set(make_divisors(b)))

c_set.sort()
print(c_set[-c])
Problem p03543 (python)

Fixed submission:
num = input()
print("Yes" if num[0] == num[1] == num[2] or num[1] == num[2] == num[3] else "No")

Buggy submission (verdict: Runtime Error):
print("Yes" if input()[0] == input()[1] == input()[2]\
      or input()[1] == input()[2] == input()[3] else "No")
Problem p03760 (python)

Fixed submission:
o = input()
n1 = len(o)
e = input()
n2 = len(e)
if n1 == n2:
  for i in range(n1):
    print(o[i] + e[i], end = "")
else:
  for i in range(n2):
    print(o[i] + e[i], end = "")
  print(o[n1 - 1])

Buggy submission (verdict: Runtime Error):
o = input()
n1 = len(o)
e = input()
n2 = len(e)
for i in range(max(n1,n2)):
  print(o[i] + e[i], end = "")
Problem p03455 (python)

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

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

print('Even' if a*b % 2 == 0 else 'Odd')
Problem p03860 (python)

Fixed submission:
print("A" + input()[8] + "C")

Buggy submission (verdict: Runtime Error):
print("A" + int()[8] + "C")
Problem p03470 (python)

Fixed submission:
n = int(input())
S = set([int(input()) for i in range(n)])
print(len(S))

Buggy submission (verdict: Runtime Error):
n = int(input())
S = set([int(input()) for in range(n)])
print(len(S))

Buggy submission (verdict: Runtime Error):
n = input()
S = set([int(input()) for in range(n)])
print(len(S))

Buggy submission (verdict: Runtime Error):
n = input()
S = set(int(input()) for in range(n))
print(len(S))
Problem p03071 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>=3200:
   print(s)
if a<3200:
   print("red")
Problem p03206 (python)

Fixed submission:
q={22:"Christmas Eve Eve Eve",23:"Christmas Eve Eve",24:"Christmas Eve",25:"Christmas"}
print(q[int(input())])

Buggy submission (verdict: Runtime Error):
q={22:"Christmas Eve Eve Eve",23:"Christmas Eve Eve",24:"Christmas Eve",25:"Christmas"}
print(q[int(input())]
Problem p03469 (python)

Fixed submission:
a=input()
a=a.replace("2017","2018")
print(a)

Buggy submission (verdict: Runtime Error):
a=input()
a[3]="8"
print(a)
Problem p03547 (python)

Fixed submission:
li=["A","B","C","D","E","F"]
a,b=input().split()
if li.index(a)==li.index(b):
  print("=")
elif li.index(a)>li.index(b):
  print(">")
else:
  print("<")

Buggy submission (verdict: Runtime Error):
li=["A","B","C","D","E"]
a,b=input().split()
if li.index(a)==li.index(b):
  print("=")
elif li.index(a)>li.index(b):
  print(">")
else:
  print("<")
Problem p03415 (python)

Fixed submission:
a = input()
b = input()
c = input()
print(a[0] + b[1] + c[2])

Buggy submission (verdict: Runtime Error):
c11,c12,c13 = input()
c21,c22,c23 = input()
c31,c32,c33 = input()
print(c11,c12,c13[1], c21,c22,c23[2], c31,c32,c33[3])
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Buggy submission (verdict: Runtime Error):
X,A,B = map(int,input().split())
print((X-A)%B)
Problem p03469 (python)

Fixed submission:
s = input()
print('2018' + s[4:])

Buggy submission (verdict: Runtime Error):
s = ['2017', '/', '01', '/', '07']
print(s.pop[2017])
print(s.append[2018])
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
s1, s2, s3 = input().split()
print(s1,s2,s3.pop = 1)
Problem p03547 (python)

Fixed submission:
X,Y = input().split()
print('<' if X<Y  else '=' if X==Y else '>')

Buggy submission (verdict: Runtime Error):
x,y = input().split()
print('<' if x<y else '>' if x>y else '=' if x==y)

Buggy submission (verdict: Runtime Error):
x,y = input().split()
print('<' if x<y else '>' if x>y else '=' if x==y)

Buggy submission (verdict: Runtime Error):
x = input()
y = input()
a == 11
b == 12
c == 13
d == 14
f == 15
print('<' if x<y else '>' if x>y else '=' if x==y )
Problem p03555 (python)

Fixed submission:
s = input()
t = input()
print('YES' if s==t[::-1]  else 'NO')

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int(n**.5)**2)
Problem p03556 (python)

Fixed submission:
n=int(input())
print(int(n**.5)**2)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int((n**.5)**2)
Problem p03729 (python)

Fixed submission:
a,b,c = input().split()
print('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c = input().split()
if('YES' if a[-1]==b[0] and b[-1]==c[0] else 'NO')
Problem p03777 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = input()
print('H' if a==b else 'D')
Problem p04043 (python)

Fixed submission:
x = input().split()
print('YES' if x.count('5')==2 and x.count('7')==1 else 'NO')

Buggy submission (verdict: Runtime Error):
A, B, C = int(input())
print('YES' if A, B, C == 5 7 5 else 'NO')
Problem p03071 (python)

Fixed submission:
bt = input()
bt_A, bt_B = bt.split()
bt_max, bt_min = max(int(bt_A), int(bt_B)), min(int(bt_A), int(bt_B))
max_num = bt_max + max(bt_max - 1, bt_min)
print(max_num)

Buggy submission (verdict: Runtime Error):
bt = input()
bt_A, bt_B = bt.split()
bt_max, bt_min = max(bt_A, bt_B), min(bt_A, bt_B)
max_num = bt_max + max(bt_max - 1, bt_min)
print(max_num)
Problem p03071 (python)

Fixed submission:
A, B = map(int, input().split())
 
res = 0
 
if A > B:
  res = A + (A-1)
elif A == B:
  res = A + B
else:
  res = B + (B-1)
 
print(res)

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

res = 0

if A > B:
  res = A + (A-1)
elif A == B:
  res = A + B
else
  res = B + (B-1)

print(res)
Problem p03210 (python)

Fixed submission:
X = int(input())
 
if X == 3 or X == 5 or X == 7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
X = int(input())

if any(X == 3, X == 5, X == 7):
  print("YES")
else:
  print("NO")
Problem p03434 (python)

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

a.sort(reverse=True)
print(sum(a[0::2]) - sum(a[1::2]))

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

A.sort(resverse = True)

print(sum(A[0::2]) - sum(A[1::2]))

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

a.sort(reverse="True")

print(sum(a[0::2]) - sum(a[1::2]))

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

A.sort(reverse=TRUE)
print(sum(A[0::2]) - sum(A[1::2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
 
if N%2 == 0:
  print(N/2)
else:
  print([N+1] / 2)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
res = 0
 
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if 500*i + 100*j + 50*k == X:
        res += 1
 
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

res += 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500 + 100*b + c*50 == X:
        res += 1
        
print(res)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())

res = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500 + b*100 + c*50 == N:
        res += 1
       
print(res)
Problem p03455 (python)

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

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

if a*b%2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03478 (python)

Fixed submission:
N, A, B = map(int, input().split())
res = 0
for i in range(N+1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

Buggy submission (verdict: Runtime Error):
N, A ,B = map(int, input().split())
res = 0

for n in range(N+1):
  if A <= int(s) <= B for s in str(n):
    res += n
    
print(res)

Buggy submission (verdict: Runtime Error):
N, A ,B = map(int, input().split())
res = 0

for n in N:
  if A <= int(s) <= B for s in str(n):
    res += n
    
print(res)

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

res = 0

for n in range(N+1):
  if A <= sum([int(s) for s in str(n)]) <= B:
  res += n
  
print(res)

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

res = 0

for n in range(N+1):
  if A <= sum([int(s) for s in str(n)]) <= B:
  res += n
  
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
res = 0

for n in range(1+N):
  if A <= sum([int(s) for s in str(n)]) <= B:
    res += s
    
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
res = 0

for n in range(1+N):
  if A <= sum(int(s) for s in str(n)) <= B:
    res += s
    
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int input().split())
res = 0
 
for i in range(N+1):
  if A <= sum([int(n) for n in str(i)]) <= B:
    res += 1
 
print(res)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int input().split())
res = 0

for i in range(N+1):
  if A <= sum([int(n) for n in str(i)]) <= B:
    res += 1:

print(res)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
res = 0
 
while all(a%2 == 0 for a in A):
  A = [a/2 for a in A]
  res += 1
 
print(res)
Problem p03494 (python)

Fixed submission:
N = input()
A = list(map(int, input().split()))
cnt = 0
while all(a%2 == 0 for a in A):
  A = [a/2 for a in A]
  cnt += 1
print(cnt)

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

res = 0

while all(a%2 == 0 for a iin A):
  A = [a/2 for a in A]
  res += 1

print(res)

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

while all(a%2 == 0 for a in A):
  A = [a/2 a for A]
  cnt += 1

print(cnt)
Problem p03693 (python)

Fixed submission:
r, g, b = map(int, input().split())
N = r*100 + g*10 + b

if N%4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = int(input)
N = r*100 + g*10 + b

if N%4 == 0:
  print("YES")
else:
  print("NO")
Problem p03569 (python)

Fixed submission:
import sys
s = raw_input()

ss = s.replace("x","")

if(ss == ss[::-1]):
    pass

else:
    print "-1"
    sys.exit()


count = 0

right = 0
left = len(s)-1

for i in range(len(s)*2):

    if ( s[right] != s[left]):
        count += 1
        if(s[right]!="x"):
            right -= 1

        else:
            left += 1
            
    right += 1
    left -= 1
    if(right>=left):
        print count
        sys.exit()

Buggy submission (verdict: Runtime Error):
right = 0
left = len(s)-1

for i in range(len(s)*2):

    if ( s[right] != s[left]):
        count += 1
        if(s[right]!="x"):
            right -= 1

        else:
            left += 1
            
    right += 1
    left -= 1
    if(right>=left):
        print count
        sys.exit()
Problem p03587 (python)

Fixed submission:
n = raw_input()
count = 0
for i in n:
    if(i=='1'):count+=1;

print(count)

Buggy submission (verdict: Runtime Error):
n = raw_input()
count = 0
for i in n:
    if(i=='1'):count+=1;

print(count)
Problem p03729 (python)

Fixed submission:
words = input().split()
a = words[0][-1:]
b = words[1][0]
c = words[1][-1:]
d = words[2][0]
if a==b and c == d:
  print('YES')
else:
  print('NO')

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

Fixed submission:
s = input()
ans = ''
if s == 'A':
    ans = 'T'
elif s == 'T':
    ans = 'A'
elif s == 'C':
    ans= 'G'
elif s == 'G':
    ans = 'C'

print(ans)

Buggy submission (verdict: Runtime Error):
d = {'A': 'T', 'C': 'D', 'T': 'A', 'D': 'C'}
b = input()
print(d[b])
Problem p03302 (python)

Fixed submission:
a, b = map(int, input().split())
print('+' if a+b==15 else '*' if a*b==15 else 'x')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a + b == 15:
    ans = '+'
elif a * b == 15:
    ans = '*'
print(ans)
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())
print(a if a <= b else a - 1)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print(a if a <= b elif a > b a - 1)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
if a <= b:
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
cnt = 0
a, b = input().split()
d = int(a+b)
for i in l:
    if i <= d:
        cnt += 1
print(cnt)
Problem p03386 (python)

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

l = [i for i in range(A, A + K) if i <= B]
li = l + [i for i in range(B - K + 1, B + 1) if i >= A]

for i in sorted(set(li)):
    print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
num = range(A, B+1)
res = set(num[:K] | set(num[len(num) - K:]))
[print(i) for i in res]
Problem p03470 (python)

Fixed submission:
N = int(input())
l = []
for i in range(N):
    d = int(input())
    l.append(d)
cnt = set(l)
print(len(cnt))

Buggy submission (verdict: Runtime Error):
N = int(input())
d = [int(input()) for i in range(N)]
cnt = set(l)
print(len(cnt))
Problem p03485 (python)

Fixed submission:
a, b = map(int, input().split())
print(int((a+b)/2 + 0.5))

Buggy submission (verdict: Runtime Error):
mport math
a, b = map(int, input().split())
print(math.ceil((a+b)/2))
Problem p03543 (python)

Fixed submission:
N = input()
if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
	print('Yes')
else:
	print('No')
Problem p03544 (python)

Fixed submission:
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    l = L[i-1] + L[i - 2]
    L.append(l)
print(L[N])

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [2, 1]
for i in range(2, N+1):
    l = L[i-1] + L[i - 2]
    L.append(l)
print(l)