Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    S = input()

    cnt_A, cnt_B = 0

    for i in range(len(S)):
        if S[i] == "A":
            cnt_A += 1
        else:
            cnt_B += 1

    if cnt_A == 3 or cnt_B == 3:
        print('{}'.format('No'))
    else:
        print('{}'.format('Yes'))


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()

    cnt_A = 0
    cnt_B = 0

    for i in range(len(S)):
        if S[i] == "A":
            cnt_A += 1
        else:
            cnt_B += 1

    if cnt_A == 3 or cnt_B == 3:
        print('{}'.format('No'))
    else:
        print('{}'.format('Yes'))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())

apple = []
zerochk = False
tastes = 0
for i in range(N):
    taste = L + i
    apple.append(taste)
    tastes += taste
    if taste == 0: zerochk = True

ans = 0
minval = 100

if zerochk:

    print('{}'.format(tastes))

else if L > 0:

    for i in range(1, len(tastes)):
        ans += tastes(i)
    
    print('{}'.format(ans))

else: # L < 0

    for i in range(1, len(tastes)):
        minval = min(minval, abs(tastes[i]))
        ans += tastes(i)

    print('{}'.format(ans) - minval)






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

apples = []
zerochk = False
taste_sum = 0
for i in range(N):
    taste = L + i
    apples.append(taste)
    taste_sum += taste
    if taste == 0: zerochk = True


minval = 100

if zerochk:

    print('{}'.format(taste_sum))

elif L > 0:

    print('{}'.format(taste_sum - apples[0]))

else: # zerochk == True and L < 0

    for i in range(1, len(apples)):
        minval = min(minval, abs(apples[i]))

    ans = 0
    if taste_sum < 0:
        ans = abs(taste_sum) - abs(minval)
        ans *= -1
    else: # taste_sum >= 0
        ans = taste_sum - abs(minval)
    print('{}'.format(ans))
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().split)

if X < A:
    print('{}'.format('0'))
else:
    print('{}'.format('10'))

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

if X < A:
    print('{}'.format('0'))
else:
    print('{}'.format('10'))
Buggy python submission (verdict: Runtime Error):
S = input()

E1 = int(S[:2])
E2 = int(S[2:])

if E1 >= 1 and E1 <= 12 and E2 >= 1 and E2 <= 12:
  print('AMBIGUOUS')
elif E1 >= 1 and E1 <= 12:
  print('MMYY')
elif E2 >= 1 and E2 <= 12:
  print('YYMM')
else
  print('NA')










Fixed submission:
S = input()

E1 = int(S[:2])
E2 = int(S[2:])

if E1 >= 1 and E1 <= 12 and E2 >= 1 and E2 <= 12:
  print('AMBIGUOUS')
elif E1 >= 1 and E1 <= 12:
  print('MMYY')
elif E2 >= 1 and E2 <= 12:
  print('YYMM')
else:
  print('NA')
Buggy python submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())

ans = 0
i = 0

while (i * R <= N):
  
  j = 0

  while (i * R + j * G <= N):

    tmp = N - (R * i) - (G * j)
    
    if tmp % B == 0 and tmp >= 0:
      ans += 1
      # print('{},{}'.format(i,j))
    j += 1
  
  i += 1

print('{0}'.format(ans))




Fixed submission:
N, K = map(int, input().split())
ans = 0
for i in range(1, N + 1):
  if i + K - 1 <= N:
    ans += 1
  else:
    break

print('{}'.format(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)   



Fixed submission:
A, B = map(int, input().split())
ans = 0
for i in range(2):

  if A > 3 and A >= B:
    ans += A
    A -= 1
    continue

  if B > 3 and B > A:
    ans += B
    B -= 1
    continue
  
  if A == 3 and B == 3:
    ans += A

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

for i in range(len(tmp)):
  H.append(int(tmp[i]))

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)   



Fixed submission:
N = int(input())
tmp = input().split()
H = []
for i in range(len(tmp)):
  H.append(int(tmp[i]))

ans = 0
for i in range(len(H)):
  chkflg = True
  if i >= 1:
    for j in range(i): 
      if H[j] > H[i]:
        chkflg = False
        break

  if chkflg: ans += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
# x,y = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]

for x in a:
    for j in range(x,M,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]
mx = max(a)+1
for x in a:
    for j in range(x,mx,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
# x,y = map(int,input().split())
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]

for ix,x in enumerate(a):
    i = x
    while i < M:
        cnt[i] += 1
        i += x
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
ans = 0
M = 1000005
cnt = [0 for _ in range(M)]
mx = max(a)+1
for x in a:
    for j in range(x,mx,x):
        cnt[j] += 1
    
for x in a:
    if cnt[x] == 1:
        ans += 1


print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    n,k,c = map(int,input().split())
    s = list(input())
    s = list(map((lambda x: -1 if x=='o' else 0), s))
    r = s[::-1]
    ni = 0
    cnt = 0
    while(ni<n):
        if cnt>=k:
            break
        if s[ni] == -1:
            s[ni] = 1
            ni += c+1
            cnt += 1
        else:
            ni += 1
    ni = 0
    cnt = 0 
    while(ni<n):
        if cnt>=k:
            break
        if r[ni] == -1:
            r[ni] = 1
            ni += c+1
            cnt += 1
        else:
            ni += 1
    r = r[::-1]

    for i in range(n):
        if s[i] == 0:
            continue
        s_len = len([i for i in s[:i] if i==1])
        r_len = len([i for i in r[i+1:] if i==1])
        total = s_len+r_len
        # print(i)
        # print(s_len,r_len)
        if total < k:
            print(i+1)
if __name__ == '__main__':
    main()
        


Fixed submission:
n,k = map(int,input().split())
if n > k:
    if k == 1:
        print(0)
    elif k == 2:
        print(n%2)
    else:
        mod = n%k
        if k/2 < mod:
            print(k - mod)
        else:
            print(mod)
elif n == k:
    print(0)
else:
    if 2*n > k:
        print(k-n)
    else:
        print(n)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
    if i in b:
        print('NO')
        sys.exit()
    else:
        b.append(i)
print('YES')

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
if len(a) != len(set(a)):
    print('NO')
else:
    print('YES')

Buggy python submission (verdict: Time Limit Exceeded):
import sys
n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
    if i in b:
        print('NO')
        sys.exit()
    else:
        b.append(i)
print('YES')

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
if len(a) != len(set(a)):
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
import sys
a, b = map(int,input().split())
sum = a
count = 1
if b == 1:
        print(0)
else:
        for i in range(10000):
                if sum < b:
                        sum += (a-1)
                        count += 1
                else:
                        break
        print(count)

Fixed submission:
import sys
# sys.setrecursionlimit(1000000)
# N, Q = map(int, sys.stdin.readline().split())
# a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(N-1)]
# p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(Q)]
n = int(input())
h_l = list(map(int,input().split()))
c_l = [0 for _ in range(n)]
s = 0
# for i in range(n-1):
while s < n-1:
        for j in range(0,n-s-1):
                if h_l[s+j] >= h_l[s+1+j]:
                        c_l[s] += 1
                else:
                        break
        s = s+c_l[s]+1
        
# print(c_l)
print(max(c_l))
Buggy python submission (verdict: Runtime Error):
import sys
import random
n = int(input())
h = list(map(int,input().split()))

mx = h[0]
for i in range(1, n):
        
        if mx > h[i]+1:
                print('No')
                break
        mx = max(mx,h[i+1])
print('Yes')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
mx = a[0]
for i in range(1, n):
    if mx-a[i]>1:
        print("No")
        break
    mx = max(mx, a[i])
else: print("Yes")

Buggy python submission (verdict: Runtime Error):
import sys
import random
n = int(input())
h = list(map(int,input().split()))

mx = h[0]
for i in range(1, n):
        
        if mx > h[i]+1:
                print('NO')
                break
        mx = max(mx,h[i+1])
print('Yes')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
mx = a[0]
for i in range(1, n):
    if mx-a[i]>1:
        print("No")
        break
    mx = max(mx, a[i])
else: print("Yes")

Buggy python submission (verdict: Runtime Error):
import sys
import random
n = int(input())
h = list(map(int,input().split()))

mx = h[0]
for i in range(1, n):
        
        if mx > h[i]+1:
                print('NO')
                break
        mx = max(mx,h[i+1])
else: print('Yes')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
 
mx = a[0]
for i in range(1, n):
    if mx-a[i]>1:
        print("No")
        break
    mx = max(mx, a[i])
else: print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
arr = [int(input()) for i in range(n)]
for i in range(n):
    brr = copy.copy(arr)
    brr.pop(i)
    print(max(brr))

Fixed submission:
import copy

n = int(input())
arr = [int(input()) for i in range(n)]
brr = sorted(arr, reverse=True)
ind = arr.index(max(arr))
# for i in range(n):
#     brr = copy.copy(arr)
#     brr.pop(i)
#     print(max(brr))
for i in range(n):
    if i == ind:
        print(brr[1])
    else:
        print(brr[0])

Buggy python submission (verdict: Time Limit Exceeded):
import copy

n = int(input())
arr = []
for i in range(n):
    a = int(input())
    arr.append(a)
for i in range(n):
    brr = copy.copy(arr)
    brr.pop(i)
    print(max(brr))

Fixed submission:
import copy

n = int(input())
arr = [int(input()) for i in range(n)]
brr = sorted(arr, reverse=True)
ind = arr.index(max(arr))
# for i in range(n):
#     brr = copy.copy(arr)
#     brr.pop(i)
#     print(max(brr))
for i in range(n):
    if i == ind:
        print(brr[1])
    else:
        print(brr[0])
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = map(int,input().split())
cn_l, cn_r, cn_d = 0,0,0
l_list = []
r_list = []
if a%c == 0:
    start_l = a//c
else:
    start_l = a//c+1
# print('left')
cn_l = b//c+1 - start_l
# for i in range(start_l, b//c+1):
#     l_list.append(c*i)
#     cn_l += 1
if a%d == 0:
    start_r = a//d
else:
    start_r = a//d+1
# print('right')
cn_r = b//d+1 - start_r
# for i in range(start_r, b//d+1):
#     r_list.append(d*i)
#     cn_r += 1
# print(cn_l, cn_r)
# for val in l_list:
#     if val in r_list:
#         cn_d +=1
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
lcm = lcm(c,d)
if a%lcm == 0:
    start_d = a//lcm
else:
    start_d = a//lcm+1
cn_d = b//lcm+1 - start_d
n = b-a+1
print(n-(cn_l+cn_r-cn_d))



Fixed submission:
from fractions import gcd

a, b, c, d = map(int,input().split())
cn_l, cn_r, cn_d = 0,0,0
l_list = []
r_list = []
if a%c == 0:
    start_l = a//c
else:
    start_l = a//c+1
# print('left')
cn_l = b//c+1 - start_l
# for i in range(start_l, b//c+1):
#     l_list.append(c*i)
#     cn_l += 1
if a%d == 0:
    start_r = a//d
else:
    start_r = a//d+1
# print('right')
cn_r = b//d+1 - start_r
# for i in range(start_r, b//d+1):
#     r_list.append(d*i)
#     cn_r += 1
# print(cn_l, cn_r)
# for val in l_list:
#     if val in r_list:
#         cn_d +=1
def lcm(x, y):
    return (x * y) // gcd(x, y)
lcm = lcm(c,d)
if a%lcm == 0:
    start_d = a//lcm
else:
    start_d = a//lcm+1
cn_d = b//lcm+1 - start_d
n = b-a+1
print(n-(cn_l+cn_r-cn_d))

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

a, b, c, d = map(int,input().split())
cn_l, cn_r, cn_d = 0,0,0
l_list = []
r_list = []
if a%c == 0:
    start_l = a//c
else:
    start_l = a//c+1
# print('left')
cn_l = b//c+1 - start_l
# for i in range(start_l, b//c+1):
#     l_list.append(c*i)
#     cn_l += 1
if a%d == 0:
    start_r = a//d
else:
    start_r = a//d+1
# print('right')
cn_r = b//d+1 - start_r
# for i in range(start_r, b//d+1):
#     r_list.append(d*i)
#     cn_r += 1
# print(cn_l, cn_r)
# for val in l_list:
#     if val in r_list:
#         cn_d +=1
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
lcm = lcm(c,d)
if a%lcm == 0:
    start_d = a//lcm
else:
    start_d = a//lcm+1
cn_d = b//lcm+1 - start_d
n = b-a+1
print(n-(cn_l+cn_r-cn_d))



Fixed submission:
from fractions import gcd

a, b, c, d = map(int,input().split())
cn_l, cn_r, cn_d = 0,0,0
l_list = []
r_list = []
if a%c == 0:
    start_l = a//c
else:
    start_l = a//c+1
# print('left')
cn_l = b//c+1 - start_l
# for i in range(start_l, b//c+1):
#     l_list.append(c*i)
#     cn_l += 1
if a%d == 0:
    start_r = a//d
else:
    start_r = a//d+1
# print('right')
cn_r = b//d+1 - start_r
# for i in range(start_r, b//d+1):
#     r_list.append(d*i)
#     cn_r += 1
# print(cn_l, cn_r)
# for val in l_list:
#     if val in r_list:
#         cn_d +=1
def lcm(x, y):
    return (x * y) // gcd(x, y)
lcm = lcm(c,d)
if a%lcm == 0:
    start_d = a//lcm
else:
    start_d = a//lcm+1
cn_d = b//lcm+1 - start_d
n = b-a+1
print(n-(cn_l+cn_r-cn_d))
Buggy python submission (verdict: Runtime Error):
w, h, x, y = input().split()
w, h, x, y = int(w), int(h), int(x), int(y)
if (x==0) or (y==0) or (x==w/2) or (y==h/2) or (x==w) or (y==h):
    if (x==w/2) and (y==h/2):
        print(w*h/2, 1)
    else:
        print(w*h/2, 0)
else:
    if (x < w/2) and (y < h/2):
        p = (h-y)/(w-x)
        x_pos = (p*x-y)/p
        print((w-x_pos)*h/2, 0)
    elif (x > w/2) and (y < h/2):
        p = (h-y)/-x
        x_pos = (p*x-y)/p
        print(x_pos*h/2, 0)
    elif (x < w/2) and (y > h/2):
        p = -y/(w-x)
        x_pos = (h-y+p*x)/p
        print((w-x_pos)*h/2, 0)
    elif (x > w/2) and (y > h/2):
        p = y/x
        x_pos = (h-y+p*x)/p
        print(x_pos*h/2, 0)

Fixed submission:
x, a = input().split()
if x < a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
# s = [[]]
n, m = map(int,input().split())
s = [list(map(int,input().split())) for i in range(m)]

# n, m = 4, 2
# s = [[1,3], [2,4]]

if m == 1:
    print(s[0][-1] - s[0][0] + 1)
else:
    new = [[] for i in range(m)]
    for i in range(m):
        for j in range(s[i][0],s[i][1]+1):
            new[i].append(j)
    tmp = [flatten for inner in new for flatten in inner]
    c = collections.Counter(tmp)
    count = 0
    for i, num in c.most_common():
        if num == m:
            count += 1
        else:
            break
    print(count)

Fixed submission:
import collections
# s = [[]]
n, m = map(int,input().split())
s = [list(map(int,input().split())) for i in range(m)]

# n, m = 4, 2
# s = [[1,3], [2,4]]

if m == 1:
    print(s[0][-1] - s[0][0] + 1)
else:
    l = s[0][0]
    r = s[0][1]
    for i in range(1,m):
        l = max(l,s[i][0])
        r = min(r,s[i][1])
    print(max(r-l+1,0))

Buggy python submission (verdict: Time Limit Exceeded):
import collections
# s = [[]]
n, m = map(int,input().split())
s = [list(map(int,input().split())) for i in range(m)]

# n, m = 4, 2
# s = [[1,3], [2,4]]
new = [[] for i in range(m)]
for i in range(m):
    for j in range(s[i][0],s[i][-1]+1):
        new[i].append(j)
tmp = [flatten for inner in new for flatten in inner]
c = collections.Counter(tmp)
count = 0
for i, num in c.most_common():
    if num == m:
        count += 1
    else:
        break
print(count)

Fixed submission:
import collections
# s = [[]]
n, m = map(int,input().split())
s = [list(map(int,input().split())) for i in range(m)]

# n, m = 4, 2
# s = [[1,3], [2,4]]

if m == 1:
    print(s[0][-1] - s[0][0] + 1)
else:
    l = s[0][0]
    r = s[0][1]
    for i in range(1,m):
        l = max(l,s[i][0])
        r = min(r,s[i][1])
    print(max(r-l+1,0))
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int,input().split())
l = list(map(int,input().split()))
s = [list(map(int,input().split())) for i in range(m)]
# n,m = 3,2
# l = [5,1,4]
# s = [[2,3],[1,5]]
# l = [1, 8, 5, 7, 100, 4, 52, 33, 13, 5]
for i in range(m):
    l.sort()
    for j in range(s[i][0]):
        if l[j] < s[i][1]:
            l[j] = s[i][1]
        else:
            break
print(sum(l))


Fixed submission:
n, m = map(int,input().split())
l = list(map(int,input().split()))
s = [list(map(int,input().split())) for i in range(m)]
# n,m = 3,2
# l = [5,1,4]
# s = [[2,3],[1,5]]
# l = [1, 8, 5, 7, 100, 4, 52, 33, 13, 5]
l.sort()
s.sort(key=lambda x: x[1], reverse=True)
idx = 0
for i in range(m):
    for j in range(idx, min(n, idx + s[i][0])):
        if l[j] < s[i][1]:
            l[j] = s[i][1]
    idx += s[i][0]
        # else:
        #     idx += s[i][0]
        #     break
print(sum(l))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
s = list(s)
s[k] = s[k].lower()
print(''.join(s))

Fixed submission:
n, k = map(int, input().split())
s = input()
s = list(s)
s[k-1] = s[k-1].lower()
print(''.join(s))
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = list(map(int, input().split()))
# a = 
# b = 10
# gcd_list = []
# for i in range(n-1):
#     gcd_list.appned(gcd(a[i],a[i+1]))
# divisors_ll = []
# def gcd(n, a):

#     a_list = []
#     b_list = []
#     for i in range(1,a+1):
#         a_list.append(int(a//i))
#     for i in range(1,b+1):
#         b_list.append(int(b//i))
#     set_list = list(set(a_list) & set(b_list))
#     return max(set_list))
gcd_l = []
divisors_ll = []
for i in range(len(a)):
    divisors_ll.append([int(a[i]//j) for j in range(1,a[i]+1) if a[i]%j == 0])
for i in range(len(a)):
    divisors_ll_copy = divisors_ll.copy()
    divisors_ll_copy.pop(i)
    divisors_ll_copy
    tmp_l = [flatten for inner in divisors_ll_copy for flatten in inner]
    c = collections.Counter(tmp_l)
    tmp = []
    for v, count in c.most_common():
        if count == (len(a)-1):
            tmp.append(v)
    gcd_l.append(max(tmp))
print(max(gcd_l))



Fixed submission:
# import math
n = int(input())
s = list(map(int,input().split()))

def gcd(a,b):
    if (a==0) or (b==0):
        return max(a,b) 
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

lm = [0] *(n+1)
rm = [0] *(n+1)
for i in range(1,n):
    lm[i+1] = gcd(lm[i],s[i-1])
for i in range(n-1,0,-1):
    rm[i] = gcd(rm[i+1],s[i])

ans = float('-inf')
for i in range(1,n+1):
    ans = max(ans,gcd(lm[i],rm[i]))
print(ans)
Buggy python submission (verdict: Runtime Error):
ab = input().split()
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

Fixed submission:
ab = input().split()
ab[0] = int(ab[0])
ab[1] = int(ab[1])
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

Buggy python submission (verdict: Runtime Error):
ab = input().split()
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)

Fixed submission:
ab = input().split()
ab[0] = int(ab[0])
ab[1] = int(ab[1])
coin = 0
for i in range(2):
  if ab[0] >= ab[1]:
    coin += ab[0]
    ab[0] = ab[0] - 1 
  else:
    coin += ab[1]
    ab[1] = ab[1] - 1 
print(coin)
Buggy python submission (verdict: Runtime Error):
str = input()
if str == "A":
  print(T)
elif str == "T":
  print(A)
elif str == "C":
  print(G)
elif str == "G":
  print(C)

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

Buggy python submission (verdict: Runtime Error):
str = input()
if str = "A":
  print("T")
elif str = "T":
  print("A")
elif str = "C":
  print("G")
elif str = "G":
  print("C")

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

Buggy python submission (verdict: Runtime Error):
str = input()
if str = "A":
  print(T)
elif str = "T":
  print(A)
elif str = "C":
  print(G)
elif str = "G":
  print(C)

Fixed submission:
str = input()
if str == "A":
  print("T")
elif str == "T":
  print("A")
elif str == "C":
  print("G")
elif str == "G":
  print("C")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np

n,W = map(int, input().split())
days = []
for _ in range(n):
    day = list(map(int, input().split()))
    days.append(day)
dp = [[1000000] * (W+1) for _ in range(n)]

# # 1日目
# dp[0][0] = days[0][0]
# dp[0][1] = days[0][1]
# dp[0][2] = days[0][2]


# for d in range(1,n):
#     for i in range(3):
#         mx = 0
#         for j in range(3):
#             if i != j:
#                 mx = max(dp[d-1][j] + days[d][i],mx)
#                 # mx = max(dp[d][i], dp[d-1][j]+ days[d][i])
#         dp[d][i] = mx
# print(max(dp[-1]))

for i in range(n):
    dp[i][0] = 0
for w in range(1,W+1):
    if w - days[0][0] >= 0:
        dp[0][w] = days[0][1]
    else:
        dp[0][w] = 0
for d in range(1,n):
    for w in range(1,W+1):
        if w - days[d][0] >= 0:
            dp[d][w] = max(dp[d-1][w], dp[d-1][w-days[d][0]] + days[d][1])
        else:
            dp[d][w] = dp[d-1][w]
print(dp[-1][-1])


Fixed submission:
n,W = map(int, input().split())
w = []
v = []
for i in range(n):
    a,b = map(int, input().split())
    w.append(a)
    v.append(b)

c = [[0 for j in range(W)] for i in range(n)]
for i in range(W):
    if i+1 < w[0]:
        c[0][i] = 0
    else:
        c[0][i] = v[0]

for i in range(1,n):
    for j in range(W):
        if j+1 < w[i]:
            c[i][j] = c[i-1][j]
        else:
            diff = (j+1)-w[i]
            if diff > 0:
                c[i][j] = max(c[i-1][j], v[i]+c[i-1][diff-1])
            else:
                c[i][j] = max(c[i-1][j], v[i])
print(max(c[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(float,input().split()))

dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(n):
        dp[i+1][j+1] += dp[i][j]*p[i]
        dp[i+1][j] += dp[i][j]*(1-p[i])
res = 0
for j in range((n+1)//2,n+1):
    res += dp[n][j]
print(res)

    

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

dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
dp[0][0] = 1
for i in range(n):
    for j in range(n):
        dp[i+1][j+1] += dp[i][j]*p[i]
        dp[i+1][j] += dp[i][j]*(1-p[i])
res = 0
for j in range((n+1)//2,n+1):
    res += dp[n][j]
print(res)