Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = list(map(int, input().split()))
c = []
for i in range(a):
    d = False
    for j in range(len(c)):
        if c[j][0] == b[i]:
            c[j][1] += 1
            d = True
            break
    if not d:
        c.append([b[i], 1])
c = sorted(c, key=lambda x: x[0], reverse=True)
if len(c) <= 1:
    print(a // 2)
else:
    e = [c[0][0], c[1][0]] + b
    f = [c[1][0], c[0][0]] + b
    ec = 0
    fc = 0
    for i in range(2, len(e)):
        if e[i] != e[i-2]:
            e[i] = e[i-2]
            ec += 1
        if f[i] != f[i-2]:
            f[i] = f[i-2]
            fc += 1
    print(min(ec, fc))


Fixed submission:
a = int(input())
b = list(map(int, input().split()))
c = {}
for i in range(a):
    if str(b[i]) in c:
        c[str(b[i])] += 1
    else:
        c[str(b[i])] = 1
c = sorted(c.items(), key=lambda x: x[1], reverse=True)
if len(c) <= 1:
    print(a // 2)
elif len(c) == 2:
    e = [int(c[0][0]), int(c[1][0])] + b
    f = [int(c[1][0]), int(c[0][0])] + b
    ec = 0
    fc = 0
    for i in range(2, len(e)):
        if e[i] != e[i-2]:
            e[i] = e[i-2]
            ec += 1
        if f[i] != f[i-2]:
            f[i] = f[i-2]
            fc += 1
    print(min(ec, fc))
elif len(c) >= 3:
    e = [int(c[0][0]), int(c[1][0])] + b
    f = [int(c[1][0]), int(c[0][0])] + b
    g = [int(c[0][0]), int(c[2][0])] + b
    h = [int(c[1][0]), int(c[2][0])] + b
    j = [int(c[2][0]), int(c[0][0])] + b
    k = [int(c[2][0]), int(c[1][0])] + b

    ec = 0
    fc = 0
    gc = 0
    hc = 0
    jc = 0
    kc = 0
    for i in range(2, len(e)):
        if e[i] != e[i-2]:
            e[i] = e[i-2]
            ec += 1
        if f[i] != f[i-2]:
            f[i] = f[i-2]
            fc += 1
        if g[i] != g[i-2]:
            g[i] = g[i-2]
            gc += 1
        if h[i] != h[i-2]:
            h[i] = h[i-2]
            hc += 1
        if j[i] != j[i-2]:
            j[i] = j[i-2]
            jc += 1
        if k[i] != k[i-2]:
            k[i] = k[i-2]
            kc += 1
    print(min(ec, fc, gc, hc, jc, kc))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

a, b = map(int, input().split())
c = []
for i in range(1, a + 1):
    if i % b == 0 or i % b == b / 2:
        c.append(i)
d = 0
for i in itertools.product(c, repeat=3):
    if (i[0] + i[1]) % b == 0 and (i[0] + i[2]) % b == 0 and (i[1] + i[2]) % b == 0:
        d += 1
print(d)


Fixed submission:
a, b = map(int, input().split())
c = []
d = []
for i in range(1, a + 1):
    if i % b == 0:
        c.append(i)
    elif i % b == b / 2:
        d.append(i)
e = 0
print(len(c) * len(c) * len(c) + len(d) * len(d) * len(d))
Buggy python submission (verdict: Runtime Error):
a = input()
if len(a) == 0:
    print("WA")
    exit()
if a[0] == "A":
    b = 0
    for i in range(1, len(a)):
        if a[i] == "C" and (1 < i < len(a) - 1):
            b += 1
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
if b == 1:
    print("AC")
else:
    print("WA")

Fixed submission:
a = input()
b = 0
if a[0] != "A":
    print("WA")
    exit()
for i in range(2,len(a)-1):
    if b == 0 and a[i] == "C":
        b = i
    elif b != 0 and [i] == "C":
        print("WA")
        exit()
if b == 0:
    print("WA")
    exit()
for i in range(len(a)):
    if i != 0 and i != b and a[i].isupper():
        print("WA")
        exit()
print("AC")

Buggy python submission (verdict: Runtime Error):
a = input()
if a[0] == "A":
    b = 0
    for i in range(1, len(a)):
        if a[i] == "C" and (1 < i < len(a) - 1):
            b += 1
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
if b == 1:
    print("AC")
else:
    print("WA")

Fixed submission:
a = input()
b = 0
if a[0] != "A":
    print("WA")
    exit()
for i in range(2,len(a)-1):
    if b == 0 and a[i] == "C":
        b = i
    elif b != 0 and [i] == "C":
        print("WA")
        exit()
if b == 0:
    print("WA")
    exit()
for i in range(len(a)):
    if i != 0 and i != b and a[i].isupper():
        print("WA")
        exit()
print("AC")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = list(map(int, input().split()))


Fixed submission:
a = int(input())
c = list(map(int, input().split()))
d = {0: 1}
e = 0
for i in range(len(c)):
    e += c[i]
    if e not in d:
        d[e] = 1
    else:
        d[e] += 1
ans = 0
for v in d.values():
    if v >= 2:
        ans += v * (v - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = [False] *(10**5)
for i in range(a):
    c = int(input())
    b[c-1] = not b[c-1]
d = 0
for i in b:
    if i:
        d += 1
print(d)


Fixed submission:
a = int(input())
b = {}
for i in range(a):
    c = int(input())
    if c not in b:
        b[c] = 1
    else:
        b[c] += 1
c = 0
for k, v in b.items():
    if v % 2 != 0:
        c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = [0] * (10 ** 5)
c = list(map(int, input().split()))
for i in c:
    b[i-1] += 1
d = 0
e = 0
for i in range(len(b)-1, -1, -1):
    if b[i] >= 2:
        if d == 0:
            d = i+1
        elif e == 0:
            e = i+1
        else:
            print(d*e)
            exit()
print(d*e)


Fixed submission:
a = int(input())
b = list(map(int, input().split()))
b = sorted(b, reverse=True)
c = []
d = []
for i in range(1, len(b)):
    if i-1 not in d:
        if b[i] == b[i-1]:
            c.append(b[i])
            d.append(i)
        if len(c) == 2:
            print(c[0] * c[1])
            exit()
print(0)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = []
d = []
for i in range(a):
    c.append(list(input()))
for i in range(b):
    d.append(list(input()))
for i in range(a-b+1):
    for j in range(a-b+1):
        m = n = 0
        o = True
        for k in range(i,i+b):
            n = 0
            for l in range(k, k+b):
                if c[k][l] != d[m][n]:
                    o = not o
                n += 1
            m += 1
        if o:
            print("Yes")
            exit()
print("No")


Fixed submission:
a, b = map(int, input().split())
c = []
d = ""
for i in range(a):
    c.append(list(input()))
for i in range(b):
    d += input()
e = []
for i in range(a-b+1):
    for j in range(a-b+1):
        f = ""
        for k in range(b):
            for l in range(b):
                f += c[i+k][j+l]
        e.append(f)
print("Yes" if d in e else "No")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = []
d = ""
for i in range(a):
    c.append(list(input()))
for i in range(b):
    d += input()
e = []
for i in range(b):
    for j in range(b):
        f = ""
        for k in range(b):
            for l in range(b):
                f += c[i+k][j+l]
        e.append(f)
print("Yes" if d in e else "No")


Fixed submission:
a, b = map(int, input().split())
c = []
d = ""
for i in range(a):
    c.append(list(input()))
for i in range(b):
    d += input()
e = []
for i in range(a-b+1):
    for j in range(a-b+1):
        f = ""
        for k in range(b):
            for l in range(b):
                f += c[i+k][j+l]
        e.append(f)
print("Yes" if d in e else "No")
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
d = e = 0
for i in range(a):
    b, c = map(int, input().split())
    if i == 0:
        d = b
        e = c
    else:
        f = b
        g = c
        while True:
            if d <= f and e <= g:
                d = f
                e = g
                break
            else:
                f += b
                g += c
print(d + e)


Fixed submission:
a = int(input())
b = [list(map(int, input().split()))for _ in range(a)]
c = []
for i in range(len(b)):
    c.append(b[i].copy())
    if len(c) != 1:
        while True:
            if c[i][0] < c[i-1][0] or c[i][1] < c[i-1][1]:
                c[i][0] = b[i][0] * max((c[i-1][0] + b[i][0] - 1) // b[i][0], (c[i-1][1] + b[i][1] - 1) // b[i][1])
                c[i][1] = b[i][1] * max((c[i-1][0] + b[i][0] - 1) // b[i][0], (c[i-1][1] + b[i][1] - 1) // b[i][1])
            else:
                break
print(c[len(c)-1][0] + c[len(c)-1][1])

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = [list(map(int, input().split()))for _ in range(a)]
c = []
for i in range(len(b)):
    c.append(b[i].copy())
    if len(c) != 1:
        while True:
            if c[i][0] < c[i-1][0] or c[i][1] < c[i-1][1]:
                c[i][0] = c[i][0] + b[i][0]
                c[i][1] = c[i][1] + b[i][1]
            else:
                break
print(c[len(c)-1][0] + c[len(c)-1][1])


Fixed submission:
a = int(input())
b = [list(map(int, input().split()))for _ in range(a)]
c = []
for i in range(len(b)):
    c.append(b[i].copy())
    if len(c) != 1:
        while True:
            if c[i][0] < c[i-1][0] or c[i][1] < c[i-1][1]:
                c[i][0] = b[i][0] * max((c[i-1][0] + b[i][0] - 1) // b[i][0], (c[i-1][1] + b[i][1] - 1) // b[i][1])
                c[i][1] = b[i][1] * max((c[i-1][0] + b[i][0] - 1) // b[i][0], (c[i-1][1] + b[i][1] - 1) // b[i][1])
            else:
                break
print(c[len(c)-1][0] + c[len(c)-1][1])
Buggy python submission (verdict: Runtime Error):
def clc(a, b, c, p, t):
    if c == 0:
        b = a[0]
        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)
    elif c == len(a)-1:
        if p:
            return t + int(b) + int(a[c])
        else:
            return t + int(b + a[c])
    else:
        if p:
            t += int(b)
            b = a[c]
        else:
            b += a[c]
        return clc(a, b, c + 1, True, t) + clc(a, b, c + 1, False, t)


s = input()
print(clc(s, "", 0, True, 0))


Fixed submission:
def f(a, b, le, tf):
    b[le] = tf
    if le == len(b)-1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le+1, 0) + f(a, b, le+1, 1)


aa = input()
bb = [0] * (len(aa)-1)
if len(aa) == 1:
    print(aa)
else:
    print(f(aa, bb, 0, 0) + f(aa, bb, 0, 1))

Buggy python submission (verdict: Runtime Error):
def f(a, b, le, tf):
    b[le] = tf
    if le == len(b)-1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le+1, 0) + f(a, b, le+1, 1)


aa = input()
bb = [0] * (len(aa)-1)
if len(a) == 1:
    print(a)
else:
    print(f(aa, bb, 0, 0) + f(aa, bb, 0, 1))

Fixed submission:
def f(a, b, le, tf):
    b[le] = tf
    if le == len(b)-1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le+1, 0) + f(a, b, le+1, 1)


aa = input()
bb = [0] * (len(aa)-1)
if len(aa) == 1:
    print(aa)
else:
    print(f(aa, bb, 0, 0) + f(aa, bb, 0, 1))

Buggy python submission (verdict: Runtime Error):
def f(a, b, le, tf):
    b[le] = tf
    if le == len(b)-1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le+1, 0) + f(a, b, le+1, 1)


aa = input()
bb = [0] * (len(aa)-1)
print(f(aa, bb, 0, 0) + f(aa, bb, 0, 1))


Fixed submission:
def f(a, b, le, tf):
    b[le] = tf
    if le == len(b)-1:
        t = ""
        s1 = 0
        for i in range(len(b)):
            t += a[i]
            if b[i] == 1:
                s1 += int(t)
                t = ""
        t += a[len(b)]
        s1 += int(t)
        return s1
    else:
        return f(a, b, le+1, 0) + f(a, b, le+1, 1)


aa = input()
bb = [0] * (len(aa)-1)
if len(aa) == 1:
    print(aa)
else:
    print(f(aa, bb, 0, 0) + f(aa, bb, 0, 1))
Buggy python submission (verdict: Runtime Error):
a = list(input())
for i in range(len(a)):
    if a[i] == "B":
        if i > 0
            a[i] = ""
            for j in range(i-1, -1, -1):
            if a[j] != "":
                a[j] = ""
print("".join(a))


Fixed submission:
a = input()
b = ""
for i in range(len(a)):
    if a[i] == "0":
        b += "0"
    elif a[i] == "1":
        b += "1"
    else:
        b = b[:-1]
print(b)
Buggy python submission (verdict: Runtime Error):
N, Q = [int(s) for s in input().split()]
S = input()

ac = []
for i in range(len(S)):
    if S[i] == 'A' and S[i+1] == 'C':
        ac.append((i + 1, i + 2))
    i += 1
# print(ac)

for i in range(Q):
    l, r = [int(s) for s in input().split()]
    ans = 0
    for a, b in ac:
        if l <= a and b <= r:
            ans += 1
    print(ans)

Fixed submission:
N, Q = [int(s) for s in input().split()]
S = input()

t = [0 for i in range(N+1)]
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == 'AC' else 0)
for i in range(Q):
    l, r = [int(s) for s in input().split()]
    print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

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

n = input()
alist = [int(s) for s in input().split()]

print(gcd_list(alist))


Fixed submission:
import fractions
from functools import reduce

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

n = input()
alist = [int(s) for s in input().split()]

print(gcd_list(alist))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

print((a - 1) * (b - 1))

Fixed submission:
a, b = map(int, input().split())
 
print((a - 1) * (b - 1))
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, m = input().split()
n = int(n)
m = int(m)

# a[i] = 0 の床は踏めない
a = np.ones(n+1, dtype=np.bool)
for _ in range(m):
    a[int(input())] = 0

mod = 1e9 + 7

# pos[i]はi段目まで登る場合の数
pos = np.zeros(n+1)
pos[0] = 1
for i in range(n):
    if i == n - 1:
        pos[i+1] += pos[i]
    else:
        if a[i+1]:
            pos[i+1] += pos[i]
        if a[i+2]:
            pos[i+2] += pos[i]

print(int(pos[n] % mod))

Fixed submission:
import numpy as np

n, m = input().split()
n = int(n)
m = int(m)

# a[i] = 0 の床は踏めない
a = np.ones(n+1, dtype=np.bool)
for _ in range(m):
    a[int(input())] = 0

mod = 1e9 + 7

# pos[i]はi段目まで登る場合の数
pos = np.zeros(n+1)
pos[0] = 1
for i in range(n-1):
    if a[i+1]:
        pos[i+1] += pos[i]
        pos[i+1] %= mod
    if a[i+2]:
        pos[i+2] += pos[i]
        pos[i+2] %= mod

pos[n] += pos[n-1]

print(int(pos[n] % mod))
Buggy python submission (verdict: Runtime Error):
N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2=1:
    count += 1

print(count)

Fixed submission:
N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2==1:
    count += 1

print(count)

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

count = 0
for i in range(1,N+1):
  if len(str(i))%2=1:
    count += 1

print(count)

Fixed submission:
N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2==1:
    count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N,D = map(int,input().split())

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in len(row):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])^2
      if (dist**1/2) == int:
      	count += 1
    row.append(x)
      
print(count)

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

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in range(len(row)):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])**2
      if (dist**0.5)-int(dist**0.5)==0:
      	count += 1
    row.append(x)
      
print(count)
Buggy python submission (verdict: Runtime Error):
s = [_ for _ in input()]
s_s = list(set(s))

if len(s_s) >= 3:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

if len(s_s) >= 3:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
s_s = listed(set(s))

if len(s_s) >= 3:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

if len(list(set(s))) >= 3:
  print("No")
else:
  s_s = list(set(s))
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

if len(list(set(s))) >= 3:
  print("No")
else:
  s = list(set(s))
  if s.count(s[0]) == s.count(s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

if len(list(set(s))) >= 3:
  print("No")
else:
  s = list(set(s))
  if count(s[0]) == count(s[1]):
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

for i in range(len(S)):
  if len(list(set(s))) >= 3:
    print("No")
  else:
    s = list(set(s))
    if count(s[0]) == count(s[1]):
      print("Yes")
   	else:
      print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')

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

for i in range(len(S)):
  if len(set(s)) > 3:
    print("No")
  else:
    s = list(set(s))
    if count(s[0]) == count(s[1]):
      print("Yes")
   	else:
      print("No")

Fixed submission:
s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())

p = map(int, input().split())

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0

for i in range(1,n):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0
for i in range(n):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0
for i in range(n):
  if (p[i+1]>p[i] and p[i]>=p[i-1]) or (p[i-1]>p[i] and p[i]>=p[i+1]):
    count += 1
    
print (count)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
Ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)

Fixed submission:
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
Ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)

Fixed submission:
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = input()

S[K-1]=S[K-1].lower()
print(S)

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

se = ''
for i in range(N):
    if i == K-1:
        se += S[K-1].lower()
    else:
        se += S[i]
print(se)
Buggy python submission (verdict: Runtime Error):
 S = input()

if int(S[0:2])<=12 and int(S[0:2])!=0:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('YYMM')
    else:
        print('NA')

Fixed submission:
S = input()

if int(S[0:2])<=12 and int(S[0:2])!=0:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if int(S[2:4])<=12 and int(S[2:4])!=0:
        print('YYMM')
    else:
        print('NA')
Buggy python submission (verdict: Time Limit Exceeded):
A,B,T = map(int, input().split())

i = 1
count = 0
while A*i <= (T+0.5):
  count += i * T
  
print(count)

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

i = 1
count = 0
while A*i <= (T+0.5):
  count += B
  i += 1
  
print(count)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

if a<c<b or b<c<a:
  print('Yes)
else:
  print('No)


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

if a<c<b or b<c<a:
  print('Yes')
else:
  print('No')

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

if a<c<b or b<c<a:
 print('Yes)
else:
 print('No)


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

if a<c<b or b<c<a:
  print('Yes')
else:
  print('No')