Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))

ans = [A.index(i+1)+1 for i in range(n)]
print(*ans)  

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

values = [i for i in range(1, N+1)]
dic = dict(zip(keys, values))
keys.sort()
for i in range(1, N+1):
    value = dic[i]
    print('{} '.format(value), end='')

Buggy python submission (verdict: Runtime Error):
N, K = input().strip().split()
N = int(N)
K = int(K)

h = list(map(int, input().split()))

count = 0
for i in range(N):
    if h[i] >= K:
        count += 1
print(count)


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

values = [i for i in range(1, N+1)]
dic = dict(zip(keys, values))
keys.sort()
for i in range(1, N+1):
    value = dic[i]
    print('{} '.format(value), end='')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a <= b:
    print(1)
else:
    for i in range(20):
        if (a * i - 1) >= b:
            break
    print(i)

Fixed submission:
S = input()
T = input()

n = len(S)
cont = 0
for i in range(n):
    if S[i] == T[i]:
        cont += 1
print(cont)

Buggy python submission (verdict: Runtime Error):
"""
'S'=晴
'C'=曇
'R'=雨
3日間で天気予報が的中した日が何日あるかを出力せよ。

入力
CSS
CSR

出力
2
"""

#S= ['C', 'S', 'S']
#T= ['C', 'S', 'R']

S= input()
T= input()

S_list = []
T_list = []
def split_lint(text, list):
    words=text.split()
    for word in words:
        list.append(word)
split_lint(S, S_list)
split_lint(T, T_list)

count=0
for i in range(3):
    if S_list[i] == T_list[i]:
       count += 1
print(count)

Fixed submission:
S = input()
T = input()

n = len(S)
cont = 0
for i in range(n):
    if S[i] == T[i]:
        cont += 1
print(cont)

Buggy python submission (verdict: Runtime Error):
cout =0
S= map(str, input().split())
T= map(str, input().split())

count=0
for i in range(3):
    if S[i] == T[i]:
       count += 1
print(count)

Fixed submission:
S = input()
T = input()

n = len(S)
cont = 0
for i in range(n):
    if S[i] == T[i]:
        cont += 1
print(cont)

Buggy python submission (verdict: Runtime Error):
cout =0
S= map(input().split())
T= map(input().split())

count=0
for i in range(3):
    if S[i] == T[i]:
       count += 1
print(count)

Fixed submission:
S = input()
T = input()

n = len(S)
cont = 0
for i in range(n):
    if S[i] == T[i]:
        cont += 1
print(cont)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input=lambda :sys.stdin.readline().rstrip()
n, m = map(int, input().split())

key = [0]*n
for _ in range(m):
    l, r = map(int, input().split())
    for i in range(l-1, r):
        key[i] = key[i]+1
print(len([i for i in key if i == m]))

Fixed submission:
n, m = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(m)]

L = []
R = []
L_append = L.append
R_append = R.append
for l, r in LR:
    L.append(l)
    R.append(r)

min_R = min(R)
max_L = max(L)
if min_R >= max_L:
  ans = min_R +1 - max_L
else:
  ans = 0
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, max_w = map(int, input().split())

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

dp = [[0 for _ in range(max_w+1)] for _ in range(n+2)]

for i in range(1, n+1):
    for j in range(max_w+1):
        dp[i][j] = max(dp[i][j], dp[i-1][j])
        if j >= w[i-1]:
            dp[i][j] = max(dp[i][j], dp[i-1][j-w[i-1]]+v[i-1])

print(max(dp[n]))

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

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

f_inf = float('inf')
max_v = 100000

dp = [f_inf]*(max_v+2)
dp[0] = 0

for i in range(1, n+1):
    for j in range(max_v+1, -1, -1):
        if j >= v[i-1]:
            dp[j] = min(dp[j], dp[j-v[i-1]]+w[i-1])

ans = 0
for i in range(max_v+1):
    if dp[i] <= max_w:
        ans = max(ans, i)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()

cnt = 0
while "BW" in S:
    cnt += S.count("BW")
    S = S.replace("BW", "WB")

print(cnt)


Fixed submission:
S = input()

ans = 0
cnt = 0
for i in range(len(S)):
    if S[i] == "B":
        cnt += 1
    else:
        ans += cnt
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

cnt = 0
idx = 0
while "BW" in S:
    if S[idx:idx+2] == "BW":
        cnt += 1
        S = S[:idx] + "WB" + S[idx+2:]
        idx = 0
    else:
      idx += 1
      
print(cnt)


Fixed submission:
S = input()

ans = 0
cnt = 0
for i in range(len(S)):
    if S[i] == "B":
        cnt += 1
    else:
        ans += cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
XYH = [list(map(int, input().split())) for _ in range(n)]
x1, y1, h1 = XYH[0]
# print(x1, y1, h1)

for Cx in range(101):
    for Cy in range(101):
        H = h1 + abs(x1-Cx) + abs(y1-Cy)
        # print(Cx, Cy, H)
        if all(h == max(H-abs(x-Cx)-abs(y-Cy), 0) for x, y, h in XYH:
            print(Cx, Cy, H)
            exit()





Fixed submission:
n = int(input())
XYH = [list(map(int, input().split())) for _ in range(n)]
#print(XYH)

for x1, y1, h1 in XYH:
    if h1 > 0:
        for Cx in range(101):
            for Cy in range(101):
                H = h1 + abs(x1 - Cx) + abs(y1 - Cy)
                # print(Cx, Cy, H)
                if all(h == max(H - abs(x - Cx) - abs(y - Cy), 0) for x, y, h in XYH):
                  print(Cx, Cy, H)
                  exit()
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))

cont = 0

for i in sorted(a):
    x -= i
    if x >= 0:
        cont += 1
    else:
        break

if x > 0:
    cont -= 1

print(cont)

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

cont = 0

for i in sorted(a):
    x -= i
    if x >= 0:
        cont += 1
    else:
        break

if x > 0:
    cont -= 1

print(cont)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
MAXN = 110000

f_inf = float('inf')
dp = [f_inf] * (MAXN+n)

dp[0] = 0

for i in range(1, n+2):
    power6 = 1
    power9 = 1
    for j in range(1, n+1):
        if i >= power6:
            dp[i] = min(dp[i], dp[i-power6]+1)
            power6 *= 6

    for k in range(1, n+1):
        if i >= power9:
            dp[i] = min(dp[i], dp[i-power9]+1)
            power9 *= 9

print(dp[n])


Fixed submission:
n = int(input())
MAXN = 110000

f_inf = float('inf')
dp = [f_inf] * (MAXN+n)

dp[0] = 0

for i in range(1, n+2):
    for j in range(7):
        dp[i] = min(dp[i], dp[i-pow(6, j)]+1)
    for k in range(6):
        dp[i] = min(dp[i], dp[i-pow(9, k)]+1)

print(dp[n])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
MAXN = 110000

f_inf = float('inf')
dp = [f_inf] * (MAXN+n)

dp[0] = 0

for i in range(1, n+2):
    power6 = 1
    power9 = 1
    for j in range(1, n+1):
        if i >= power6:
            dp[i] = min(dp[i], dp[i-power6]+1)
            power6 *= 6

    for k in range(1, n+1):
        if i >= power9:
            dp[i] = min(dp[i], dp[i-power9]+1)
            power9 *= 9

print(dp[n])

Fixed submission:
n = int(input())
MAXN = 110000

f_inf = float('inf')
dp = [f_inf] * (MAXN+n)

dp[0] = 0

for i in range(1, n+2):
    for j in range(7):
        dp[i] = min(dp[i], dp[i-pow(6, j)]+1)
    for k in range(6):
        dp[i] = min(dp[i], dp[i-pow(9, k)]+1)

print(dp[n])
Buggy python submission (verdict: Runtime Error):
n = int(input())

def Checker(sum, x):
    sum =  0
    while x > 0:
        sum += x % 10
        x = x // 10
    return sum

sum_list = []
for a in range(2, n):
    b = n - a
    sum_a = 0
    sum_b = 0
    y = 0

    y = Checker(sum_a, a)+ Checker(sum_b, b)
    sum_list.append(y)

print(min(sum_list))

Fixed submission:
n = int(input())

def Checker(sum, x):
    sum =  0
    while x > 0:
        sum += x % 10
        x = x // 10
    return sum

sum_list = []
for a in range(1, n):
    b = n - a
    sum_a = 0
    sum_b = 0
    
    y = Checker(sum_a, a)+ Checker(sum_b, b)
    sum_list.append(y)

print(min(sum_list))

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

def Checker(sum, x):
    sum =  0
    while x > 0:
        sum += x % 10
        x = x // 10
    return sum

sum_list = []
for a in range(2, n):
    b = n - a
    sum_a = 0
    sum_b = 0

    y = Checker(sum_a, a)+ Checker(sum_b, b)
    sum_list.append(y)

print(min(sum_list))

Fixed submission:
n = int(input())

def Checker(sum, x):
    sum =  0
    while x > 0:
        sum += x % 10
        x = x // 10
    return sum

sum_list = []
for a in range(1, n):
    b = n - a
    sum_a = 0
    sum_b = 0
    
    y = Checker(sum_a, a)+ Checker(sum_b, b)
    sum_list.append(y)

print(min(sum_list))
Buggy python submission (verdict: Runtime Error):
x = int(input())

ans = 0
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
        tmp = i ** j
        #tmp = pow(i, j)
        if tmp > x:
            tmp = i ** (j-1)
            #tmp = pow(i, j-1)
            #print(tmp, i, j)
            break
    ans = max(tmp, ans)

print(ans)

Fixed submission:
x = int(input())

ans = 0
tmp = 1
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
      tmp = pow(i, j)
      if tmp > x:
          tmp = pow(i, j-1)
          #print(tmp, i, j)
          break

    ans = max(tmp, ans)

print(ans)

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

ans = 0
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
        tmp = pow(i, j)
        if tmp > x:
            tmp = pow(i, j-1)
            #print(tmp, i, j)
            break
    ans = max(tmp, ans)

print(ans)

Fixed submission:
x = int(input())

ans = 0
tmp = 1
for i in range(1, int(x**0.5)+1):
    for j in range(2, x):
      tmp = pow(i, j)
      if tmp > x:
          tmp = pow(i, j-1)
          #print(tmp, i, j)
          break

    ans = max(tmp, ans)

print(ans)
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

S = collections.Counter(s)
T = collections.Counter(t)

ans = [0]
for key, cont in S:
    if cont > T[key]:
        ans.append(cont - T[key])
print(max(ans))

Fixed submission:
a, b, c = map(int, input().split())
if a+b < c:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import collections

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

S = collections.Counter(s)
T = collections.Counter(t)

ans = [0]
for key, cont in S:
    if cont > T[key]:
        ans.append(cont - T[key])
print(max(ans))

Fixed submission:
import collections
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

S = collections.Counter(s)
T = collections.Counter(t)


ans = [0]
for key, cont in S.most_common():
  if cont > T[key]:
    ans.append(cont-T[key])
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from itertools import accumulate

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0: return False
  return True

q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    A = [i for i in range(l, r+1, 2)]
    B = [(a+1)//2 for a in A]
    A_B = [0] +[1 for i in range(len(A)) if is_prime(A[i]) and is_prime(B[i])]
    print(max(accumulate(A_B)))

Fixed submission:
import math
from itertools import accumulate

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0: return False
  return True

MAX = (10**5)+1
q = int(input())
A = [1 if is_prime(i)and is_prime((i + 1)//2) else 0 for i in range(MAX) ]
S = [0] + list(accumulate(A))

Q =[]
Q_append = Q.append
for _ in range(q):
    l, r = map(int, input().split())
    Q_append((l, r))

for qi in Q:  
    print(S[qi[1]+1]-S[qi[0]])

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

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0:
      return False
  return True

q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    A = [i for i in range(l, r+1, 2)]
    B = [(a+1)//2 for a in A]
    cnt = 0
    for i in range(len(A)):
      if is_prime(A[i]) and is_prime(B[i]):
        cnt += 1
    print(cnt)

Fixed submission:
import math
from itertools import accumulate

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0: return False
  return True

MAX = (10**5)+1
q = int(input())
A = [1 if is_prime(i)and is_prime((i + 1)//2) else 0 for i in range(MAX) ]
S = [0] + list(accumulate(A))

Q =[]
Q_append = Q.append
for _ in range(q):
    l, r = map(int, input().split())
    Q_append((l, r))

for qi in Q:  
    print(S[qi[1]+1]-S[qi[0]])

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate
import math

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0:
      return False
  return True

q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    A = [i for i in range(l, r+1, 2)]
    B = [(a+1)//2 for a in A]
    cnt = 0
    for i in range(len(A)):
      if is_prime(A[i]) and is_prime(B[i]):
        cnt += 1
    print(cnt)

Fixed submission:
import math
from itertools import accumulate

def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n))+1):
    if n % k == 0: return False
  return True

MAX = (10**5)+1
q = int(input())
A = [1 if is_prime(i)and is_prime((i + 1)//2) else 0 for i in range(MAX) ]
S = [0] + list(accumulate(A))

Q =[]
Q_append = Q.append
for _ in range(q):
    l, r = map(int, input().split())
    Q_append((l, r))

for qi in Q:  
    print(S[qi[1]+1]-S[qi[0]])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        try:
            w = (N * h * n) / (4 * (h * n) - (N * n) - (N * h))
        except:
            continue
        if w.is_integer() and 0 < w and w < 3501:
            if 4 * (h * n * w) == N * ((n * w) + (h * w) + (h * n)):
                ans = [h, n, int(w)]
                exit(print(' '.join(map(str, ans))))

Fixed submission:
N = int(input())

for h in range(1, 3501):
    for n in range(1, 3501):
        try:
            w = (N * h * n) / (4 * (h * n) - (N * n) - (N * h))
        except:
            continue
        if w.is_integer() and w > 0:
            if 4 * (h * n * w) == N * ((n * w) + (h * w) + (h * n)):
                ans = [h, n, int(w)]
                exit(print(' '.join(map(str, ans))))
Buggy python submission (verdict: Time Limit Exceeded):
import sys 
input = sys.stdin.readline
import itertools

def Washall_Floyd(d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])
    return d

n, m, r = map(int, input().split())
R = list(map(int, input().split()))
f_inf = float('inf')
dist = [[f_inf]*n for _ in range(n)]
for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    dist[a][b] = c
    dist[b][a] = c

Washall_Floyd(dist)
S = [i for i in itertools.permutations(R, r)]
cnt = f_inf
for s in S:
  tmp = 0
  for i in range(len(s)-1):
    tmp += dist[s[i]-1][s[i+1]-1]
  cnt = min(cnt, tmp)
print(cnt)


Fixed submission:
import sys 
input = sys.stdin.readline
import itertools

def Washall_Floyd(d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k]+d[k][j])
    return d

n, m, r = map(int, input().split())
R = list(map(int, input().split()))
f_inf = float('inf')
dist = [[f_inf]*n for _ in range(n)]
for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    dist[a][b] = c
    dist[b][a] = c

Washall_Floyd(dist)
S = [i for i in itertools.permutations(R, r)]
cnt = f_inf
for s in S:
  tmp = 0
  for i in range(len(s)-1):
    tmp += dist[s[i]-1][s[i+1]-1]
  cnt = min(cnt, tmp)
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
P = list(map(int, input().split()))

ans = 0
Cnt = []
for idx, p in enumerate(P, 1):
    if idx == p:
        Cnt.append(idx)
#print(Cnt)
if len(Cnt) == 0:
    ans = 0

elif len(Cnt) == 2:
    ans += Cnt[1] - Cnt[0]

elif len(Cnt) %2:
    for i in range(1, len(Cnt), 2):
        if i == 0:
            ans += Cnt[i+1] - Cnt[i]
        elif i == len(Cnt)-1:
            ans += Cnt[i] - Cnt[i-1]
        else:
            ans += min(Cnt[i] - Cnt[i-1], Cnt[i+1] - Cnt[i])
else:
    for i in range(0, len(Cnt), 2):
        if i == 0:
            ans += Cnt[i+1] - Cnt[i]
        elif i == len(Cnt)-1:
            ans += Cnt[i] - Cnt[i-1]
        else:
            ans += min(Cnt[i] - Cnt[i-1], Cnt[i+1] - Cnt[i])

print(ans)

########################

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

Cnt = []
cnt = 0
ans = 0
for idx, p in enumerate(P, 1):
    if idx == p:
        Cnt.append(idx)
        cnt += 1
    else:
        cnt = 0
    if cnt == 2:
        ans -= 1
        cnt = 0

ans += len(Cnt)
print(ans)


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

Cnt = []
cnt = 0
ans = 0
for idx, p in enumerate(P, 1):
    if idx == p:
        Cnt.append(idx)
        cnt += 1
    else:
        cnt = 0
    if cnt == 2:
        ans -= 1
        cnt = 0

ans += len(Cnt)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
set_A = sorted((set(A)), reverse=True)

cnt = 0
for a in set_A:
  if A.count(a) >= 4:
    print(max(cnt*a, a*a))
    exit()
  if A.count(a) >= 2:
    tmp = cnt * a
    if tmp != 0:
      print(tmp)
      exit()
    cnt = a
    
print(0)


Fixed submission:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A_dic = Counter(A)

set_A = sorted((set(A)), reverse=True)
tmp = 0
for a in set_A:
    if A_dic[a] >= 4:
        print(max(tmp*a, a*a))
        exit()
    if A_dic[a] >= 2:
        ans = tmp * a
        if ans != 0:
            print(ans)
            exit()
        tmp = a
print(0)

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

Side = [0] * (10**5+1)
for a in A: Side[a] += 1

Side_2 = [i for i, x in enumerate(Side) if (x >= 2) and (x < 4)]
Side_4 = [i for i, x in enumerate(Side) if x >= 4]

if (len(Side_2) < 2) and not Side_4:
  print(0)
  exit()

if not Side_2 and Side_4:
  print(Side_4[-1]*2)
  exit()

if (len(Side_2) >= 2) and not Side_4:
  print(Side_2[-1]*Side_2[-2])
  exit()
  
if (len(Side_2) == 1) and Side_4:
  max2 = Side_2[-1]
  max4 = Side_4[-1]
  if max4 >= max2:
    print(max4*2)
    exit()
  else:
    print(max4*max2)
    exit()
    
if (len(Side_2) >= 2) and Side_4:
  max2 = Side_2[-1]
  max2_2 = Side_2[-2]
  max4 = Side_4[-1]
  if max4 >= max2:
    print(max4*2)
    exit()
  elif (max4 < max2) and (max4 <= max2_2):
    print(max2 * max2_2)
    exit()
  elif (max4 < max2) and (max4 > max2_2):
    print(max2 * max4)
    exit()

Fixed submission:
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
A_dic = Counter(A)

set_A = sorted((set(A)), reverse=True)
tmp = 0
for a in set_A:
    if A_dic[a] >= 4:
        print(max(tmp*a, a*a))
        exit()
    if A_dic[a] >= 2:
        ans = tmp * a
        if ans != 0:
            print(ans)
            exit()
        tmp = a
print(0)
Buggy python submission (verdict: Runtime Error):
n = int(input())

cont = 0
cont_list = [1]
cont_num =[]

for i in range(1, n+1):
    cont_num.append(i)
    while i % 2 == 0:
        i //= 2
        cont += 1
    cont_list.append(cont)
    cont = 0


if max(cont_list) == 1:
    print(1)
else:
    print(cont_num[cont_list.index(max(cont_list))])

Fixed submission:
n = int(input())

ans = 1
while ans * 2 <= n:
    ans *= 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n, p = map(int, input().split())
A = list(map(int, input().split()))         
C =[list(combinations(A, i)) for i in range(1, n+1)]

#print(C)
if p==0:
  cnt = 1
  for cs in C:
    for c in cs:
      if sum(c) % 2 == 0:
        #print(sum(c))
        cnt += 1
if p==1:
  cnt = 0
  for cs in C:
    for c in cs:
      if sum(c) % 2 == 1:
        cnt += 1
print(cnt)
  
 

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

for a in A:
  if a % 2 != 0:
    break 
else:
  if p == 1: 
    print(0)
    exit()
  if p == 0: 
    print(2**n)
    exit()
  
ans = 2**(n-1)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if 3200 <= a:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

MIN >= 1:
    print(MIN, (MIN+H))
MIN = 0:
    print(1, H)

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

Colors = []
High_scorer = []
for a in A:
    if a < 400:
        Colors.append("Gray")
    if 400 <= a and a < 800:
        Colors.append("Brown")
    if 800 <= a and a < 1200:
        Colors.append("Green")
    if 1200 <= a and a < 1600:
        Colors.append("Light_blue")
    if 1600 <= a and a < 2000:
        Colors.append("Blue")
    if 2000 <= a and a < 2400:
        Colors.append("Yellow")
    if 2400 <= a and a < 2800:
        Colors.append("Orange")
    if 2800 <= a and a < 3200:
        Colors.append("Red")
    if 3200 <= a:
        High_scorer.append(a)

MIN = len(set(Colors))
H = len(High_scorer)

if MIN >= 1:
    print(MIN, (MIN+H))
elif MIN == 0:
    print(1, H)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(int(input()) for i in range(n))

ans = sum(S)
sort_S = sorted(S)

if ans % 10 != 0:
    print(ans)
    exit()
else:
    for s in sort_S:
        if s % 10 != 0:
            ans -= s
            print(ans)
            exit()
print(0)

Fixed submission:
n = int(input())
S = list(int(input()) for i in range(n))

ans = sum(S)
sort_S = sorted(S)

if ans % 10 != 0:
    print(ans)
    exit()
else:
    for s in sort_S:
        if s % 10 != 0:
            ans -= s
            print(ans)
            exit()
print(0)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a == b == c:
    print(-1)
    exit()

if a%2!=0 or b%2!=0 or c%2!=0:
  	print(0)
    exit()

N = (a+b+c)//3
cnt = 1
while N:
    if N%2 != 0: break
    N //= 2
    cnt += 1
    
print(cnt)

Fixed submission:
a, b, c = map(int, input().split())
 
if a % 2 == 1 or b % 2 == 1 or c % 2 == 1:
    print(0)
elif a == b == c:
    print(-1)
else:
    num = 0
    while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
        a, b, c = (b+c)/2, (a+c)/2, (a+b)/2
        num += 1
    print(num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

ans = 1
x = 0

for i in range(n-1):
    if A[i] < A[i+1]:
        if x == -1:
            ans += 1
            x = 0
        elif x == 0:
            x = 1
    elif A[i] > A[i+1]:
        if x == 1:
            ans += 1
            x = 0
        elif x == 0:
            x = -1
print(ans)

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

ans = 1
x = 0

for i in range(n-1):
    if a[i] < a[i+1]:
        if x == -1:
            ans += 1
            x = 0
        elif x == 0:
            x = 1
    elif a[i] > a[i+1]:
        if x == 1:
            ans += 1
            x = 0
        elif x == 0:
            x = -1
print(ans)