Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,m = map(int,input().split())
ref = list(map(int,input().split()))
ran = list(map(int,input().split()))
ticket = []
ans = min(ref) + min(ran)
for i in range(m):
  t = list(map(int,input().split()))
  p = t[0] - 1
  q = t[1] - 1
  if ref[p] + ran[p] < ans:
    ans = ref[p] + ran[p]
print(ans)

Fixed submission:
a,b,m = map(int,input().split())
ref = list(map(int,input().split()))
ran = list(map(int,input().split()))

ans = min(ref) + min(ran)

for i in range(m):
  t = list(map(int,input().split()))
  p = t[0] 
  q = t[1]
  c = t[2]
  if (len(ref) >= p and len(ran) >= q):
    if ref[p - 1] + ran[q - 1] - c < ans:
      ans = ref[p - 1] + ran[q - 1] - c
      
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
SC = []

for i in range(M):
  sc = list(map(int,input().split()))
  SC.append(sc)

num = [0] * N

for i in range(M):
  s = SC[i][0]
  c = SC[i][1]
  if (num[s - 1] != 0 and num[s - 1] != c) or (s == 1 and c == 0):
    num = -1
    break
  else:
    num[s - 1] = SC[i][1]

if num == -1:
  print(-1)
else:
  ans = ""
  for i in range(M):
    if num[0] == 0:
      num[0] = 1
    ans += str(num[i])
  print(int(ans))

Fixed submission:
N,M = map(int,input().split())
SC = []

for i in range(M):
  sc = list(map(int,input().split()))
  SC.append(sc)

num = [0] * N

for i in range(M):
  s = SC[i][0]
  c = SC[i][1]
  #すでに値が入っており異なる値か、人ケタメに0を指定しているか
  if (num[s - 1] != 0 and num[s - 1] != c) or (N > 1 and s == 1 and c == 0):
    num = -1
    break
  else:
    num[s - 1] = SC[i][1]

if num == -1:
  print(-1)
else:
  ans = ""
  for i in range(N):
    if num[0] == 0 and len(num) > 1:
      num[0] = 1
    ans += str(num[i])
  ans = int(ans)
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int,input().split()))

con = 0

for i in range(1,N):
  if P[i] <= min(P[:i]):
    con += 1

print(con + 1)

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

inf = 10 ** 9

Q = [inf] * N

m = inf

con = 0

for i in range(0,N):
  if P[i] <= m:
    m = P[i]
  Q[i] = m
  if P[i] <= Q[i]:
    con += 1

print(con)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import itertools

H,W = map(int,input().split())
labyrinth = [[] for i in range(H)]
points = []

for i in range(H):
  w = list(input())
  labyrinth[i] = w
  for j in range(W):
    if w[j] == ".":
      points.append([j,i])


com = list(itertools.combinations(points,2))

#移動パターン
movex = [1,0,-1,0]
movey = [0,1,0,-1]

def shortest_path(sx,sy,gx,gy,labyrinth):
  INF = 10 ** 2

  x_length = W
  y_length = H
  distance = [[INF for i in range(x_length)] for j in range(y_length)]
  
  queue = deque()
  queue.append((sx,sy))
  distance[sy][sx] = 0
  
  #幅優先探索
  def bfs():
    #探索候補がある限り
    while len(queue) > 0:
      x,y = queue.popleft()
      
      #ゴールの座標に達したら中止
      if x == gx and y == gy:
        break
        
      for i in range(0, 4):
        nx = x + movex[i]
        ny = y + movey[i]

        #探索迷路内であり
        if (0 <= nx and ny < y_length and 0 <= ny and nx < x_length):
          #通行可能かつ未到達であれば
          if (labyrinth[ny][nx] != "#"  and distance[ny][nx] == INF):
            queue.append((nx,ny))
            distance[ny][nx] = distance[y][x] + 1
    
    return distance[gy][gx]

  return bfs()

path = []

for i in range(len(com)):
  s = com[i][0]
  g = com[i][1]
  sx = s[0]
  sy = s[1]
  gx = g[0]
  gy = g[1]
  dist = shortest_path(sx,sy,gx,gy,labyrinth)
  path.append(dist)
  
print(max(path))


Fixed submission:
from collections import deque
import itertools

H,W = map(int,input().split())
labyrinth = [[] for i in range(H)]
points = []

for i in range(H):
  w = list(input())
  labyrinth[i] = w
  for j in range(W):
    if w[j] == ".":
      points.append([j,i])

com = list(itertools.combinations(points,2))

#移動パターン
movex = [1,0,-1,0]
movey = [0,1,0,-1]

def shortest_path(sx,sy,labyrinth):
  INF = -(10 ** 6)

  x_length = W
  y_length = H
  distance = [[INF for i in range(x_length)] for j in range(y_length)]
  
  queue = deque()
  queue.append((sx,sy))
  distance[sy][sx] = 0
  
  #幅優先探索
  def bfs():
    #探索候補がある限り
    while len(queue) > 0:
      x,y = queue.popleft()

      #上下左右を探索
      for i in range(0, 4):
        nx = x + movex[i]
        ny = y + movey[i]
        #print(nx,ny)
        #探索迷路内であり
        if (0 <= nx and ny < y_length and 0 <= ny and nx < x_length):
          #通行可能かつ未到達であれば
          if (labyrinth[ny][nx] != "#"  and distance[ny][nx] == INF):
            queue.append((nx,ny))
            distance[ny][nx] = distance[y][x] + 1
    
    dismax = max(list(itertools.chain.from_iterable(distance)))

    return dismax
    
  return bfs()

path = 0

for i in range(len(points)):
  sx = points[i][0]
  sy = points[i][1]
  dist = shortest_path(sx,sy,labyrinth)
  if path < dist:
    path = dist
  
print(path)
Buggy python submission (verdict: Runtime Error):
N,A,B = map(int,input().split())

if (B - A) % 2 == 0:
  print((B - A) // 2)
else:
  if 
  print(min(B - 1 , N - A))

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

if (B - A) % 2 == 0:
  print((B - A) // 2)
else:
  NA = N - A
  B1 = B - 1
  if NA < B1:
    distance = N - B
    adjust = distance + 1
    moveA = A + adjust
    print(((N - moveA) // 2) + adjust)
  else:
    distance = A - 1
    adjust = distance + 1
    moveB = B - adjust
    print(((moveB - 1) // 2) + adjust)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
L = list(S)
first = [L.index(str(i)) if str(i) in S else None for i in range(10)]
con = 0

for n in range(0,1000):
  c = str(n)
  c = "0" * (3 - len(c)) + c
  m = int(c[0])
  y = int(c[1])
  z = int(c[2])
  if ((first[m] != None) and (first[y] != None) and (first[z] != None) ) and first[m] < N - 1:
    i = first[m]
    for j in range(i + 1,len(S) - 1):
        if S[j] == c[1] and c[2] in S[j + 1:]:
          con += 1
          break

print(con)

Fixed submission:
N = int(input())
S = input()
con = 0

for i in range(10):
  if str(i) in S:
    p = S.index(str(i))
    S2 = S[p + 1:]
    for j in range(10):
      if str(j) in S2:
        q = S2.index(str(j))
        S3 = S2[q + 1:]
        for k in range(10):
          if str(k) in S3:
            con += 1

print(con)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
L = list(S)
first = [L.index(str(i)) if str(i) in S else None for i in range(10)]
con = 0

for n in range(0,1000):
  c = str(n)
  c = "0" * (3 - len(c)) + c
  if first[int(c[0])] != None and first[int(c[0])] < N - 1:
    i = first[int(c[0])]
    for j in range(i + 1,len(S) - 1):
        if S[j] == c[1] and c[2] in S[j + 1:]:
          con += 1
          break

print(con)


Fixed submission:
N = int(input())
S = input()
con = 0

for i in range(10):
  if str(i) in S:
    p = S.index(str(i))
    S2 = S[p + 1:]
    for j in range(10):
      if str(j) in S2:
        q = S2.index(str(j))
        S3 = S2[q + 1:]
        for k in range(10):
          if str(k) in S3:
            con += 1

print(con)

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

con = 0

for n in range(0,1000):
  c = str(n)
  c = "0" * (3 - len(c)) + c
  for i in range(len(S) - 2):
    if S[i] == c[0]:
      for j in range(i + 1,len(S) - 1):
        if S[j] == c[1] and c[2] in S[j + 1:]:
          con += 1
          break
      break

print(con)

Fixed submission:
N = int(input())
S = input()
con = 0

for i in range(10):
  if str(i) in S:
    p = S.index(str(i))
    S2 = S[p + 1:]
    for j in range(10):
      if str(j) in S2:
        q = S2.index(str(j))
        S3 = S2[q + 1:]
        for k in range(10):
          if str(k) in S3:
            con += 1

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

X,Y = map(int,input().split())

if (X + Y) % 3 != 0:
  print(0)
  
else:
  a = Y - (X + Y) // 3
  b = X - (X + Y) // 3
  total = a + b
  m = min(a,b)
  def permod(n, r):
    return (math.factorial(n) // math.factorial(n - r)) % (10 ** 9 + 7)
  
  ans = permod(total,m)
  print(ans)

Fixed submission:
r = int(input())

print(r ** 2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())



L = []

for i in range(1,N):
  diff = N - i
  pair = sorted([i,diff])
  pair = set(pair)
  if len(pair) == 2 and pair not in L:
    L.append(pair)

print(len(L))


Fixed submission:
N = int(input())

sup = int(N // 2) + 1

L = []

for i in range(1,sup):
  diff = N - i
  pair = [i,diff]
  pair = set(pair)
  if len(pair) == 2:
    L.append(pair)


    
print(len(L))

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

INF = 10 ※※ 8

L = []

for i in range(1,N):
  diff = N - i
  pair = set(i,diff)
  if len(pair) == 2 and pair not in L:
    L.append(pair)

print(len(L))

Fixed submission:
N = int(input())

sup = int(N // 2) + 1

L = []

for i in range(1,sup):
  diff = N - i
  pair = [i,diff]
  pair = set(pair)
  if len(pair) == 2:
    L.append(pair)


    
print(len(L))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from functools import reduce

N = int(input())
distance = []
C = []

def prime_f(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a  
A = prime_f(N)

if len(A) == 1:
  print(N - 1)
else:
  for i in range(1,len(A)):
    C = list(set(itertools.combinations(A,i)))
    for j in range(0,len(C)):
      totalC = reduce(lambda x,y:x*y,C[j])
      div = int(N / totalC)
      distance.append(div + totalC)

  print(min(distance) - 2)

Fixed submission:
n = int(input())

distance = 10 ** 12

i = 1

while i * i <= n:
  if n % i == 0:
    m = int(n / i)
    move = (m - 1) + (i - 1)
    if move < distance:
      distance = move
  i += 1

print(distance)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
from functools import reduce

N = int(input())

def prime_f(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
    
A = prime_f(N)

F = []
L = []

distance = []

C = []

if len(A) == 1:
  print(N - 1)
else:
  for i in range(1,len(A)):
    C = list(itertools.combinations(A,i))
    for j in range(0,len(C)):
      totalC = reduce(lambda x,y:x*y,C[j])
      div = int(N / totalC)
      distance.append(div + totalC)

  print(min(distance) - 2)

Fixed submission:
n = int(input())

distance = 10 ** 12

i = 1

while i * i <= n:
  if n % i == 0:
    m = int(n / i)
    move = (m - 1) + (i - 1)
    if move < distance:
      distance = move
  i += 1

print(distance)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
L = []
for i in range(1,N + 1):
  if N % i == 0:
    div = int(N / i)
    distance = (div + i - 2)
    L.append(distance)
    
print(min(L))

Fixed submission:
n = int(input())

distance = 10 ** 12

i = 1

while i * i <= n:
  if n % i == 0:
    m = int(n / i)
    move = (m - 1) + (i - 1)
    if move < distance:
      distance = move
  i += 1

print(distance)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())

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

edge = list(itertools.combinations(L,3))

con = 0

for i in range(0,len(edge)):
	edge[i] = list(edge[i])
	edge[i].sort(reverse = True)
	a = edge[i][0]
	b = edge[i][1]
	c = edge[i][2]
	if a < b + c:
		con += 1
		
print(con)

Fixed submission:
from bisect import bisect_left

N = int(input())

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

L.sort()

con = 0

for i in range(0,N):
  for j in range(i + 1,N):
    a = L[i]
    b = L[j]
    #a + bよりでかい最小の数のインデックス
    p = bisect_left(L,a + b)
    #cとbの間の区間を取る
    con += (p - 1) - j


print(con)

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

N = int(input())

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

con = 0

edge = list(itertools.combinations(L,3))

for i in range(0,len(edge)):
	a = edge[i][0]
	b = edge[i][1]
	c = edge[i][2]
	total = sum(edge[i])
	if a < b + c and b < a + c and c < a + b:
		con += 1
		
print(con)

Fixed submission:
from bisect import bisect_left

N = int(input())

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

L.sort()

con = 0

for i in range(0,N):
  for j in range(i + 1,N):
    a = L[i]
    b = L[j]
    #a + bよりでかい最小の数のインデックス
    p = bisect_left(L,a + b)
    #cとbの間の区間を取る
    con += (p - 1) - j


print(con)
Buggy python submission (verdict: Runtime Error):
N,K,Q = map(int, input().split())

P = [0] * N


 
for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')

Fixed submission:
S = input()
 
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
elif S == "Rainy":
  print("Sunny")

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

if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy"):
elif S == "Rainy":
  print("Sunny")

Fixed submission:
S = input()
 
if S == "Sunny":
  print("Cloudy")
elif S == "Cloudy":
  print("Rainy")
elif S == "Rainy":
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
S = input()
 
for i in range(0,int(len(S)):
	if i % 2 == 0:
		if L[i] == "L": #奇数
			print("No")
		break
	elif i % 2 == 1
		if L[i] == "R":
			print("No")
		break
else:print("Yes")	 

Fixed submission:
L = input()
 
for i in range(0,int(len(L))):
	if (i % 2) == 0:
		if L[i] == "L": #奇数
			print("No")
			break
	elif (i % 2) == 1:
		if L[i] == "R":
			print("No")
			break
else:print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q = map(int, input().split())
 
A = []
 
for _ in range(Q):
    A.append(int(input()))
	
P = [K] * N
 
r = 0
 
for i in range(0,len(A)):
	r = A[i] - 1
	P[r] += 1
	P = list(map(lambda x: x-1,P))
	
for i in range(0,len(P)):
	if P[i] > 0:
		print("Yes")
	else:print("No")

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

P = [0] * N


for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')

Buggy python submission (verdict: Runtime Error):
N,K,Q = map(int, input().split()))
 
A = []
 
for _ in range(Q):
    A.append(int(input()))
	
P = [K] * N
 
r = 0
 
for i in range(0,len(A)):
	r = A[i] - 1
	P[r] += 1
	P = list(map(lambda x: x-1,P))
	
for i in range(0,len(P)):
	if P[i] > 0:
		print("Yes")
	else:print("No")

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

P = [0] * N


for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')

Buggy python submission (verdict: Time Limit Exceeded):
L = list(map(int, input().split()))
 
N = L[0]
K = L[1]
Q = L[2]
 
A = []
 
for _ in range(Q):
    A.append(int(input()))
	
P = [K] * N
 
 
r = 0
 
for i in range(0,len(A)):
	r = A[i] - 1
	P[r] += 1
	P = list(map(lambda x: x-1,P))
	
for i in range(0,len(P)):
	if P[i] > 0:
		print("Yes")
	else:print("No")

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

P = [0] * N


for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')

Buggy python submission (verdict: Time Limit Exceeded):
L = list(map(int, input().split()))

N = L[0]
K = L[1]
Q = L[2]

A = []

for _ in range(Q):
    A.append(int(input()))
	
P = [K] * N


r = 0

for i in range(0,len(A)):
	r = A[i] - 1
	P[r] += 1
	P = list(map(lambda x: x-1,P))
	
for i in range(0,len(P)):
	if P[i] > 0:
		print("Yes")
	else:print("No")

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

P = [0] * N


for i in range(Q):
	A = int(input())
	P[A-1] += 1


for j in range(0,len(P)):
	if K - Q + P[j] > 0:
		print('Yes')
	else:
		print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
 
N,M = map(int, input().split())
L = list(map(int, input().split()))
 
L = sorted(L,reverse=True)
 
 
for i in range(0,M):
	L[0] = int(math.floor(L[0] / 2))
	L = sorted(L,reverse=True)
	
print(sum(L))

Fixed submission:
import heapq

N,M = map(int, input().split())
L = [-int(i) for i in input().split()]
heapq.heapify(L)



for i in range(M):
    h = -(-heapq.heappop(L) // 2)
 
    heapq.heappush(L,h)

print(-sum(L))

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

N,M = map(int, input().split())
L = list(map(int, input().split()))

L = sorted(L,reverse=True)


while M > 0:
	L[0] = int(math.floor(L[0] / 2))
	L = sorted(L,reverse=True)
	
	M -= 1
	
print(sum(L))



Fixed submission:
import heapq

N,M = map(int, input().split())
L = [-int(i) for i in input().split()]
heapq.heapify(L)



for i in range(M):
    h = -(-heapq.heappop(L) // 2)
 
    heapq.heappush(L,h)

print(-sum(L))

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

N,M = map(int, input().split())
L = list(map(int, input().split()))

L = sorted(L,reverse=True)


for i in range(0,M):
	L[0] = int(math.floor(L[0] / 2))
	L = sorted(L,reverse=True)
	
print(sum(L))

Fixed submission:
import heapq

N,M = map(int, input().split())
L = [-int(i) for i in input().split()]
heapq.heapify(L)



for i in range(M):
    h = -(-heapq.heappop(L) // 2)
 
    heapq.heappush(L,h)

print(-sum(L))
Buggy python submission (verdict: Runtime Error):
N = int(input())
B = list(map(int, input().split()))

A = [0] * N

for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = B[0]
A[N-1] = B[N-2]

print(sum(A))

Fixed submission:
n = int(input())

ans = n ** 3

print(ans)

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

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = min(B[0],B[1])
A[N-1] = B[N-2]

print(sum(A))

Fixed submission:
n = int(input())

ans = n ** 3

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

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = min(B[0],B[1])
A[N-1] = B[N-2]

print(sum(A))

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

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = B[0]
A[N-1] = B[N-2]


print(sum(A))

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

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = min(B[0],B[1])
A[N-1] = B[N-2]

print(A)

print(sum(A))

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

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = B[0]
A[N-1] = B[N-2]


print(sum(A))
Buggy python submission (verdict: Runtime Error):
def swap():
  N,K = map(int,input().split())
  S = list(input())
  l = 0
  r = N - 1
  ans = 0
  while K > 0:
    for i in range(0,N - 1):
      if S[i] != S[i + 1]:
        left = i + 1
        break
    for j in range(N - 1,-1,-1):
      if S[j] != S[j - 1]:
        right = j
        break
    if left == right:
      right = N
    for i in range(left,right):
      s = S[i]
      if s == "L":
        S[i] = "R"
      else:
        S[i] = "L"
    K -= 1
  
  for i in range(0,N):
    j = (-i - 1)
    if S[i] == "L" and S[i] == S[i - 1] and i > 0:
      ans += 1
    if S[j] == "R" and S[j + 1] == S[j] and i > 0:
      ans += 1

  print(ans)
  
swap()

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

score = 0

for i in range(1,N):
  if S[i] == S[i - 1]:
    score += 1
    
ans = min(score + 2 * K,N - 1)

print(ans)
Buggy python submission (verdict: Runtime Error):
print(sum([int(i) for i in range(int(input()))]))

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

counter = 0

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

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

counter = 0

max_n = 0

for i in range(1,N):
	if L[i] <= L[i-1]:
		counter += 1
	else:
		max_m = max(max_n,counter)
		ct = 0
			
print(max(max_n,counter))

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

counter = 0

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

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

counter = 0

max_n = 0

for i in range(N-1):
	if L[i] <= L[i-1]:
		counter += 1
	else:
		max_m = max(max_n,counter)
		ct = 0
			
print(max(max_n,counter))

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

counter = 0

for i in range(0,3):
  if S[i] == T[i]:
    counter += 1
    
print(counter)
Buggy python submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())

X = B / A

print(math.ceil(X))

Fixed submission:
A, B = map(int, input().split())
 
X = ((B-2) // (A-1)) + 1

print(X)

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

A = int(input())
B = int(input())

X = B / A
XX = B // A

if XX == 0:
    print(X)
else:
    print(math.ceil(X))

Fixed submission:
A, B = map(int, input().split())
 
X = ((B-2) // (A-1)) + 1

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

counter = 0

max_n = 0

for i in range(0,N):
	if L[i] > L[i+1]:
		counter += 1
	else:
		max_m = max(max_m,counter)
		ct = 0
			
print(max(max_m,counter))

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]

Max =  0
Count = 0
for i in range(N-1):
    if L[i] >= L[i+1]:
        Count += 1
    else:
        Count = 0
    if Count >= Max:
        Max = Count
print(Max)

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

count_list = [0] * N
for i in range(0,N):
	if L[i] > L[i+1]:
		counter += 1
		count_list.append(counter)

			
print(max(count_list))

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]

Max =  0
Count = 0
for i in range(N-1):
    if L[i] >= L[i+1]:
        Count += 1
    else:
        Count = 0
    if Count >= Max:
        Max = Count
print(Max)

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

count_list = []
for i in range(0,N):
	counter = 0
	for j in range(i+1,N):
		print(L[i],L[j])
		if L[i] > L[j]:
			counter = counter + 1
			
		elif L[i] <= L[j]:
			count_list.append(counter)
			break
			
print(max(count_list))

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]

Max =  0
Count = 0
for i in range(N-1):
    if L[i] >= L[i+1]:
        Count += 1
    else:
        Count = 0
    if Count >= Max:
        Max = Count
print(Max)
Buggy python submission (verdict: Time Limit Exceeded):
print(sum([int(i) for i in range(int(input()))]))

Fixed submission:
N = int(input())

ans = ((2 + N - 1) * N // 2) - N
print(ans)

Buggy python submission (verdict: Runtime Error):
print(sum([int(i) for i in range(N)]))

Fixed submission:
N = int(input())

ans = ((2 + N - 1) * N // 2) - N
print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = input()

if A >= 3200:
  print(red)
else:print(B)

Fixed submission:
A = int(input())
B = input()

if A < 3200:
  print("red")
else:print(B)