Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def c_splitting_pile(N, A):
    # Aの要素の総和をX、カードの山の先頭i枚の総和をxとすると、
    # |y-x|=|X-2x|である。各iについてこの値を計算すればよい
    total = sum(A)
    ans = float('inf')
    s = 0
    for i in range(N-1):
        s += A[i]
        ans = min(ans, abs(total - s * 2))
    return ans

N = int(input())
A = [int(i) for i in input().split()]
print(c_splitting_pile(N, A)

Fixed submission:
def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    s = lst[0]
    allsum = sum(lst)
    minimum = abs(allsum - s * 2)
    
    for k in range(1, N - 1):
        s += lst[k]
        a = abs(allsum - s * 2)
        minimum = min(minimum, a)
    return minimum

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))

Buggy python submission (verdict: Time Limit Exceeded):
def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    absolute = float('inf')
    allsum = sum(lst)
    for k in range(1, N):
        sunuke = sum(lst[:k])
        a = abs(allsum - sunuke * 2)
        if a < absolute:
            absolute = a
    return absolute

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))

Fixed submission:
def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    s = lst[0]
    allsum = sum(lst)
    minimum = abs(allsum - s * 2)
    
    for k in range(1, N - 1):
        s += lst[k]
        a = abs(allsum - s * 2)
        minimum = min(minimum, a)
    return minimum

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))

Buggy python submission (verdict: Time Limit Exceeded):
def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    absolute = float('inf')
    for k in range(1, N):
        sunuke = sum(lst[:k])
        arai = sum(lst[k:])
        a = abs(sunuke - arai)
        if a < absolute:
            absolute = a
    return absolute

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))

Fixed submission:
def Q3(x):
    N = x[0][0]
    lst = x[1][:]
    s = lst[0]
    allsum = sum(lst)
    minimum = abs(allsum - s * 2)
    
    for k in range(1, N - 1):
        s += lst[k]
        a = abs(allsum - s * 2)
        minimum = min(minimum, a)
    return minimum

l = [int(i) for i in input().split()]
m = [int(i) for i in input().split()]
n = [l,m]
print(Q3(n))
Buggy python submission (verdict: Time Limit Exceeded):
def C_pushpush(x):
    n = int(x[0])
    a = x[1:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.insert(0, a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)

Fixed submission:
def C_pushpush(x):
    from collections import deque
    # insertをリストの先頭に行うと、リストの要素の再配置に時間がかかる
    n = int(x[0])
    a = deque(x[1:])
    b = deque([])
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.appendleft(a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)

Buggy python submission (verdict: Time Limit Exceeded):
def C_pushpush(x):
    n = x[0]
    a = x[1:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.insert(0, a[i])
        else:
            b.append(a[i])
    for idx in range(len(b)):
        print(b[idx], end=' ')

n = int(input())
l = [int(i) for i in input().split()]
x = [n]+l
C_pushpush(x)

Fixed submission:
def C_pushpush(x):
    from collections import deque
    # insertをリストの先頭に行うと、リストの要素の再配置に時間がかかる
    n = int(x[0])
    a = deque(x[1:])
    b = deque([])
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.appendleft(a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)

Buggy python submission (verdict: Time Limit Exceeded):
def C_pushpush(x):
    n = x[0][0]
    a = x[1][:]
    b = []
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致しているか
            b.insert(0, a[i])
        else:
            b.append(a[i])
    for idx in range(len(b)):
        print(b[idx],end=' ')

n = int(input())
l = [int(i) for i in input().split()]
x = [[n]] + [l]
C_pushpush(x)

Fixed submission:
def C_pushpush(x):
    from collections import deque
    # insertをリストの先頭に行うと、リストの要素の再配置に時間がかかる
    n = int(x[0])
    a = deque(x[1:])
    b = deque([])
    n_parity = n & 1
    for i in range(n):
        if n_parity == (i + 1) & 1:
            # n,iのパリティが一致
            b.appendleft(a[i])
        else:
            b.append(a[i])
    print(' '.join(b))

n = input()
l = [i for i in input().split()]
x = [n]+l
C_pushpush(x)
Buggy python submission (verdict: Runtime Error):
A,B = [int(i) for i in input().split()]
if A>B:
  print('GREATER')
elif A<B:
  print('LESS')
else:
  print('EQUAL')

Fixed submission:
A = int(input())
B = int(input())
if A>B:
  print('GREATER')
elif A<B:
  print('LESS')
else:
  print('EQUAL')
Buggy python submission (verdict: Runtime Error):
O = input().strip()
E = input().strip()

end = 0
if len(O)-len(E)=1:
  end = 1
ans = ''
for i in range(len(O)-end):
  ans += O[i] + E[i]
if end==1:
  ans += O[-1]
print(ans)

Fixed submission:
O = input().strip()
E = input().strip()

end = 0
if len(O)-len(E)==1:
  end = 1
ans = ''
for i in range(len(O)-end):
  ans += O[i] + E[i]
if end==1:
  ans += O[-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = [int(i) for i in input().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')

Fixed submission:
a,b = [i for i in input().strip().split()]
if a=='H':
  if b=='H':
    print('H')
  else:
    print('D')
else:
  if b=='H':
    print('D')
  else:
    print('H')
Buggy python submission (verdict: Runtime Error):
def a_airport_bus(N, C, K, T):
    import bisect
    t = sorted(T)
    index = 0  # t[index]はまだバスに乗っていない人の内最も早い空港到着時刻
    ans = 0
    while index <= N - 1:
        # 時刻 t[index] にバスを出した場合乗り込める人数の候補
        num_take_bus = bisect.bisect_right(t, t[index] + K) - index
        if num_take_bus > C:
            index += C  # 定員分だけ乗せる
        else:
            index += tmp  # 乗れるだけ乗せる
        ans += 1  # バスを1台出した
    return ans

N, C, K = [int(i) for i in input().split()]
T = [int(input()) for _ in range(N)]
print(a_airport_bus(N, C, K, T))

Fixed submission:
def a_airport_bus(N, C, K, T):
    import bisect
    t = sorted(T)
    index = 0  # t[index]はまだバスに乗っていない人の内最も早い空港到着時刻
    ans = 0
    while index <= N - 1:
        # 時刻 t[index] にバスを出した場合乗り込める人数の候補
        num_take_bus = bisect.bisect_right(t, t[index] + K) - index
        if num_take_bus > C:
            index += C  # 定員分だけ乗せる
        else:
            index += num_take_bus  # 乗れるだけ乗せる
        ans += 1  # バスを1台出した
    return ans

N, C, K = [int(i) for i in input().split()]
T = [int(input()) for _ in range(N)]
print(a_airport_bus(N, C, K, T))
Buggy python submission (verdict: Runtime Error):
def d_menagerie(N, S):
    s = S + S[0:2]  # 円環状に並んでいることを考慮
    for ans in ['SS', 'SW', 'WS', 'WW']:  # Sは羊、Wは狼。1番と2番の種類を仮定する
        for i in range(1, N + 1):
            if (ans[-1] == 'S' and s[i] == 'o') or (ans[-1] == 'W' and s[i] == 'x'):
                # この場合、今注目している動物の両隣は同じ種類。
                # よって、今注目している動物の右隣を左隣と同じにする。
                ans += ans[-2]
            else:
                # 両隣は違う種類。右隣を左隣と逆にする。
                ans += ('S' if ans[-2] == 'W' else 'W')
        if ans[:2] == ans[N:]:
            # sの最初の2文字(仮定)と最後の2文字が一致した文字列のみ受理する。
            # 1つ見つければ良いので、すぐにbreakする
            ans = ans[:N]
            break
    else:  # どの割り当て方も矛盾した
        ans = '-1'
    return ans

N = int(input())
S = input().strip()
print(d_Menagerie(N, S))

Fixed submission:
def d_Menagerie(N, S):
    s = S + S[0:2]  # 円環状に並んでいることを考慮
    for ans in ['SS', 'SW', 'WS', 'WW']:  # Sは羊、Wは狼。1番と2番の種類を仮定する
        cond = False
        for i in range(1, N + 1):
            if (ans[-1] == 'S' and s[i] == 'o') or (ans[-1] == 'W' and s[i] == 'x'):
                # この場合、今注目している動物の両隣は同じ種類。
                # よって、今注目している動物の右隣を左隣と同じにする。
                ans += ans[-2]
            else:
                # 両隣は違う種類。右隣を左隣と逆にする。
                ans += ('S' if ans[-2] == 'W' else 'W')
        if ans[:2] == ans[N:]:
            # sの最初の2文字(仮定)と最後の2文字が一致した文字列のみ受理する。
            # 1つ見つければ良いので、すぐにbreakする
            cond = True
            ans = ans[:N]
            break
    # 目的の文字列が存在すればその文字列を返し、存在しなければ-1を返す
    if cond:
        return ans
    else:
        return '-1'
    return None

N = int(input())
S = input().strip()
print(d_Menagerie(N, S))
Buggy python submission (verdict: Runtime Error):
def a_multiple_array_(N, A, B):
    ans = 0  # ボタンを押した回数
    for k in range(N - 1, -1, -1):  # 末尾から貪欲に決めていく
        remainder = (A[k] + ans) % B[k]  # A[k]+ansが現在のA[k]の値
        if remainder != 0:  # 定義の仕方より、reminderは非負整数
            ans += B[k] - remainder
    return ans

N = int(Input())
A, B = [], []
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    A.append(a)
    B.append(b)
print(a_multiple_array_(N, A, B))

Fixed submission:
def a_multiple_array_(N, A, B):
    ans = 0  # ボタンを押した回数
    for k in range(N - 1, -1, -1):  # 末尾から貪欲に決めていく
        remainder = (A[k] + ans) % B[k]  # A[k]+ansが現在のA[k]の値
        if remainder != 0:  # 定義の仕方より、reminderは非負整数
            ans += B[k] - remainder
    return ans

N = int(input())
A, B = [], []
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    A.append(a)
    B.append(b)
print(a_multiple_array_(N, A, B))
Buggy python submission (verdict: Time Limit Exceeded):
K,S = [int(i) for i in input().split()]
ans = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S-X-Y
    if 0<=Z<=K and X+Y+Z==S:
      ans += 1
print(ans)

Fixed submission:
K,S = [int(i) for i in input().split()]
ans = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S-X-Y
    if 0<=Z<=K:
      ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def c_daydream(S):
    import re
    # Sを逆にしたものから該当する文字を除いていき、空文字列にできるか？
    s = S[::-1]
    dict = ['dream'[::-1], 'dreamer'[::-1], 'erase'[::-1], 'eraser'[::-1]]
    n = len(s)
    while n > 0:
        for d in dict:
            if s.startswith(d):
                s = re.sub('^' + d, '', s)
                break
        else:
            return 'NO'
        n = len(s)
    return 'YES'

S = input().strip()
print(c_daydream(S))

Fixed submission:
def c_Daydream(S):
    # Sを逆にしたものから一覧にある文字列を逆にしたものを除いていき、空文字にできるか？
    s = S[::-1]
    while True:
        if len(s) >= 5 and s[0:5] == 'maerd':
            s = s[5:]
        elif len(s) >= 7 and s[0:7] == 'remaerd':
            s = s[7:]
        elif len(s) >= 5 and s[0:5] == 'esare':
            s = s[5:]
        elif len(s) >= 6 and s[0:6] == 'resare':
            s = s[6:]
        elif len(s) == 0:
            return 'YES'
        else:
            return 'NO'
S = input().strip()
print(c_Daydream(S))

Buggy python submission (verdict: Runtime Error):
def c_daydream(S):
    import re
    # Sを逆にしたものから該当する文字を除いていき、空文字列にできるか？
    s = S[::-1]
    dict = ['dream'[::-1], 'dreamer'[::-1], 'erase'[::-1], 'eraser'[::-1]]
    n = len(s)
    while n > 0:
        for d in dict:
            if s.startswith(d):
                s = re.sub('^' + d, '', s)
                break
        else:
            return 'NO'
        n = len(s)
    return 'YES'

S = input().strip()
print(c_Daydream(S))

Fixed submission:
def c_Daydream(S):
    # Sを逆にしたものから一覧にある文字列を逆にしたものを除いていき、空文字にできるか？
    s = S[::-1]
    while True:
        if len(s) >= 5 and s[0:5] == 'maerd':
            s = s[5:]
        elif len(s) >= 7 and s[0:7] == 'remaerd':
            s = s[7:]
        elif len(s) >= 5 and s[0:5] == 'esare':
            s = s[5:]
        elif len(s) >= 6 and s[0:6] == 'resare':
            s = s[6:]
        elif len(s) == 0:
            return 'YES'
        else:
            return 'NO'
S = input().strip()
print(c_Daydream(S))
Buggy python submission (verdict: Runtime Error):
import sys
S = input().strip()

for j in range(len(S)):
  for k in range(j+1,len(S)):
    if S[i] == 'C' and S[j] == 'F':
      print('Yes')
      sys.exit()
print('No')

Fixed submission:
import sys
S = input().strip()

for j in range(len(S)):
  for k in range(j+1,len(S)):
    if S[j] == 'C' and S[k] == 'F':
      print('Yes')
      sys.exit()
print('No')
Buggy python submission (verdict: Runtime Error):
def c_atcodeer_and_election_report(N, R):
    t, a = 1, 1  # 高橋, 青木の票数
    for x, y in R:
        # t<=nx ∧ a<=ny を満たす最小のnを求める
        n = max(t // x, a // y)
        if t > n * x or a > n * y:
            n += 1
        t = n * x
        a = n * y
    return t + a

N = int(input())
R = [[int(i) for i in input().split()] for j in range(N)]
print(c_AtCoDeer_and_ElectionReport(N, R))

Fixed submission:
def c_AtCoDeer_and_ElectionReport(N, R):
    from math import ceil
    from decimal import Decimal
    t = 1  # 高橋の票数
    a = 1  # 青木の票数
    for x, y in R:
        n = Decimal(max(ceil(t / x), ceil(a / y)))
        t = n * x
        a = n * y
    return t + a

N = int(input())
R = [[int(i) for i in input().split()] for j in range(N)]
print(c_AtCoDeer_and_ElectionReport(N, R))
Buggy python submission (verdict: Runtime Error):
def c_atcodeer_and_election_report(N, R):
    from math import ceil
    t = 1  # 高橋の票数
    a = 1  # 青木の票数
    for x, y in R:
        # t<=nx ∧ a<=ny を満たす最小のnを求める
        n = max(ceil(t / x), ceil(a / y))
        t = n * x
        a = n * y
    return t + a
N = int(input())
R = [[int(i) for i in input().split()] for j in range(N)]
print(c_atcodeer_and_election_report(N, R))

Fixed submission:
def c_Tak_and_Cards(N, A, S):
    X = max(S + [A])
    y = [0] + [x - A for x in S]
    dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)]
    dp[0][N * X] = 1
    for j in range(N + 1):
        for t in range(2 * N * X + 1):
            if j == 0 and t == N * X:
                dp[j][t] = 1
            elif j >= 1 and (t - y[j] < 0 or t - y[j] > 2 * N * X):
                dp[j][t] = dp[j - 1][t]
            elif j >= 1 and 0 <= t - y[j] <= 2 * N * X:
                dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]]
            else:
                dp[j][t] = 0
    return dp[N][N * X] - 1
N,A = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
print(c_Tak_and_Cards(N, A, S))

Buggy python submission (verdict: Runtime Error):
def c_Tak_and_Cards(N, A, S):
    X = max(S)
    y = [x - A for x in S]
    dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)]
    dp[0][N * X] = 1
    for j in range(N):
        for t in range(X, (2 * N - 1) * X):
            dp[j + 1][t] = dp[j][t] + dp[j][t - y[j]]
    return dp[N][N * X] - 1
N,A = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
print(c_Tak_and_Cards(N, A, S))

Fixed submission:
def c_Tak_and_Cards(N, A, S):
    X = max(S + [A])
    y = [0] + [x - A for x in S]
    dp = [[0 for _ in range(2 * N * X + 1)] for _ in range(N + 1)]
    dp[0][N * X] = 1
    for j in range(N + 1):
        for t in range(2 * N * X + 1):
            if j == 0 and t == N * X:
                dp[j][t] = 1
            elif j >= 1 and (t - y[j] < 0 or t - y[j] > 2 * N * X):
                dp[j][t] = dp[j - 1][t]
            elif j >= 1 and 0 <= t - y[j] <= 2 * N * X:
                dp[j][t] = dp[j - 1][t] + dp[j - 1][t - y[j]]
            else:
                dp[j][t] = 0
    return dp[N][N * X] - 1
N,A = [int(i) for i in input().split()]
S = [int(i) for i in input().split()]
print(c_Tak_and_Cards(N, A, S))
Buggy python submission (verdict: Runtime Error):
def d_DigitSum(N, S):
    if S == N:
        # f(b,N)=Nを満たすbはN+1が最小
        return N + 1

    from math import sqrt, floor

    def f(b, n):
        if n < b:
            return n
        else:
            return f(b, floor(n / b)) + n % b
    sq = floor(sqrt(N))
    # 2<=b<=√Nまで探索
    for b in range(2, sq + 1):
        if f(b, N) == S:
            return b
    # √N<=b<=Nまで探索
    for p in range(1, sq):
        b = (N - S) // p + 1
        if f(b, N) == S:
            return b
    return -1
N = int(input())
S = int(input())
print(d_DigitSum(N, S))

Fixed submission:
def d_DigitSum(N, S):
    if S == N:
        # f(b,N)=Nを満たすbはN+1が最小
        return N + 1
    if S > N:
        return -1

    from math import sqrt, floor, ceil

    def f(b, n):
        if n < b:
            return n
        else:
            return f(b, n // b) + (n % b)

    sn = ceil(sqrt(N))
    # 2<=b<=√Nまで探索
    for b in range(2, sn + 1):
        if f(b, N) == S:
            return b
    # √N<=b<=Nまで探索
    for p in range(sn, 0, -1):
        if (N - S) % p == 0:
            b = (N - S) // p + 1
            if f(b, N) == S:
                return b
    return -1
N = int(input())
S = int(input())
print(d_DigitSum(N, S))
Buggy python submission (verdict: Runtime Error):
a,b = [int(i) for i in input().split()]
if a > 0:
  print('Positive')
elif a = 0:
  print('Zero')
else:
  if b >= 0:
    print('Zero')
  elif b-a % 2 == 0:
    print('Negative')
  else:
    print('Positive')

Fixed submission:
a,b = [int(i) for i in input().split()]
if a > 0:
  print('Positive')
elif a == 0:
  print('Zero')
else:
  if b >= 0:
    print('Zero')
  elif abs(b-a) % 2 == 0:
    print('Negative')
  else:
    print('Positive')
Buggy python submission (verdict: Runtime Error):
A, B, C = [int(i) for i in input().split()]
if sorted([A,B,C]==[5,5,7]):
  print('YES')
else:
  print('NO')

Fixed submission:
X = [int(i) for i in input().split()]
if sorted(X)==[5,5,7]:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N,L = [int(i) for i in input().split()]
S=[[i for i in input().strip()] for j in range(N)]
print(''.join(sorted(S)))

Fixed submission:
N,L = [int(i) for i in input().split()]
S=[input().strip() for j in range(N)]
print(''.join(sorted(S)))
Buggy python submission (verdict: Runtime Error):
def c_iroha_obsession(N, K, D):
    for ans in range(N, 10 * N + 1):
        for digit in str(ans):  # 1桁ずつ調べる
            if int(digit) in D:  # 嫌いな数字があった
                break
        else:  # 嫌いな数字がなかった。このときのansが解
            break
    return ans
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
print(c_IrohaObsession(N, K, D))

Fixed submission:
def c_IrohaObsession(N, K, D):
    d = [str(i) for i in D]
    i = N
    while True:
        for c in str(i):
            if c in d:
                break
        else:
            return i
        i += 1
N,K = [int(i) for i in input().split()]
D = [int(i) for i in input().split()]
print(c_IrohaObsession(N, K, D))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n%2==1:
  print("NO") 
elif:
  s1 = ""
  s2 = ""
  for i in range(0, n/2):
    s1+=s[i]
    s2+=s[n/2 + i]
  if(s1 == s2):
    print("YES")
  else:
    print("NO")


Fixed submission:
n = int(input())
s = input()
if n%2==1:
    print("No") 
else:
    s1 = ""
    s2 = ""
    for i in range(0, n//2):
        s1+=s[i]
        s2+=s[n//2 + i]
    if(s1 == s2):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n%2==1:
  print("NO") 
elif s[0:n/2] == s[n/2:-1]:
  print("YES")
else:
  print("NO")


Fixed submission:
n = int(input())
s = input()
if n%2==1:
    print("No") 
else:
    s1 = ""
    s2 = ""
    for i in range(0, n//2):
        s1+=s[i]
        s2+=s[n//2 + i]
    if(s1 == s2):
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
if n%2==1:
  print("NO") 
elif s[0:n/2] == s[n/2]:
  print("YES")
else:
  print("NO")

Fixed submission:
n = int(input())
s = input()
if n%2==1:
    print("No") 
else:
    s1 = ""
    s2 = ""
    for i in range(0, n//2):
        s1+=s[i]
        s2+=s[n//2 + i]
    if(s1 == s2):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
a, b, c=input().split()
d=a+b
e=b+c
di=int(d)
ei=int(e)
ai=int(a)
if di >=ei:
    print(di+c)
else:
    print(ai+ei)



Fixed submission:
a, b, c=input().split()
matome=[a,b,c]
mx=max(a,b,c)
mn=min(a,b,c)
mex=mx+mn
ans1=int(mex)
import statistics
md=statistics.median(matome)
ans2=int(md)
print(ans1+ans2)
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
yes=True
l=len(S)
for i in range l:
  if S[i]!=T[i]:
    yes=False
    break
if yes:
  print("Yes")
else:
  print("No")

Fixed submission:
S=input()
T=input()
yes=True
l=len(S)
for i in range(0,l):
  if S[i]!=T[i]:
    yes=False
    break
if yes:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input())
if(N==M):
  print("AC")
else:
  print("WA")

Fixed submission:
N,M=map(int,input().split())
if(N==M):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
if A<=9 && B<=9:
  print(A*B)
else:
  print(-1)


Fixed submission:
A,B = map(int,input().split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
if A<=9 && B<=9:
  print(A*B)
else:
  print(-1)

Fixed submission:
A,B = map(int,input().split())
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

def main():
    a=int(input())
    b=int(input())
    c=max(a,b)
    print(c+(c-1))

if __name__ == '__main__':
    main()

Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np

def main():
    i=list(map(int, input().split()))
    coin=0
    if (i[0]<i[1]):
        coin =coin+i[1]
        i[1] =i[1]-1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    if (i[0] < i[1]):
        coin = coin + i[1]
        i[1] = i[1] - 1
    else:
        coin = coin + i[0]
        i[0] = i[0] - 1
    print(coin)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in n:
    x,y = map(int,input().split())
    a.append([x,y])
count = 0
flag = True
for x in a:
    if x[0] == x[1]:
        count += 1
        if count == 3:
            print('Yes')
            flag = False
            break
    else:
        count = 0

if flag:
    print('No')

Fixed submission:
n = int(input())
a = []
for i in range(n):
    x,y = map(int,input().split())
    a.append([x,y])
count = 0
flag = True
for x in a:
    if x[0] == x[1]:
        count += 1
        if count == 3:
            print('Yes')
            flag = False
            break
    else:
        count = 0

if flag:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in n:
    x,y = map(int,input())
    a.append([x,y])
count = 0
flag = True
for x in a:
    if x[0] == x[1]:
        count += 1
        if count == 3:
            print('Yes')
            flag = False
            break
    else:
        count = 0

if flag:
    print('No')

Fixed submission:
n = int(input())
a = []
for i in range(n):
    x,y = map(int,input().split())
    a.append([x,y])
count = 0
flag = True
for x in a:
    if x[0] == x[1]:
        count += 1
        if count == 3:
            print('Yes')
            flag = False
            break
    else:
        count = 0

if flag:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
print((int)n*n)

Fixed submission:
n=int(input())
print(n*n)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split())
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))

Fixed submission:
a = list(map(int,input().split()))
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))
Buggy python submission (verdict: Runtime Error):
a=input()
print(3*a*a)

Fixed submission:
a=input()
print(int(a)*int(a)*3)
Buggy python submission (verdict: Runtime Error):
prunt(input()[:-8])

Fixed submission:
print(input()[:-8])

Buggy python submission (verdict: Runtime Error):
prunt(input[:-8])

Fixed submission:
print(input()[:-8])