Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
""" C
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N, A):
    M = pow(10, 9) + 7
    result = 0
    for i in range(len(A)):
        result = (result + A[i] * sum(A[i+1:len(A)])) % M
    return result

if __name__ == "__main__":
    _N = readInteger()
    _A = readIntegerSet(_N)

    print(main(_N, _A))

Fixed submission:
""" C
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N, A):
    M = pow(10, 9) + 7
    result = 0
    S = sum(A)
    for i in range(len(A)):
        S = S - A[i]
        result = (result + A[i] * S) % M
    return result

if __name__ == "__main__":
    _N = readInteger()
    _A = readIntegerSet(_N)

    print(main(_N, _A))

Buggy python submission (verdict: Time Limit Exceeded):
""" C
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def _pattern(N):
    if N > 1:
        pa = _pattern(N-1)
        return [[0] + p for p in pa] + [[1] + p for p in pa]
    else:
        return [[0], [1]]

def main(N, A):
    M = pow(10, 9) + 7
    result = 0
    for i in range(len(A)):
        for j in range(i+1, len(A)):
            result = (result + A[i] * A[j]) % M
    return result

if __name__ == "__main__":
    _N = readInteger()
    _A = readIntegerSet(_N)

    print(main(_N, _A))

Fixed submission:
""" C
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N, A):
    M = pow(10, 9) + 7
    result = 0
    S = sum(A)
    for i in range(len(A)):
        S = S - A[i]
        result = (result + A[i] * S) % M
    return result

if __name__ == "__main__":
    _N = readInteger()
    _A = readIntegerSet(_N)

    print(main(_N, _A))
Buggy python submission (verdict: Time Limit Exceeded):
""" C
    https://atcoder.jp/contests/aising2020/tasks/aising2020_c
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N):
    for n in range(1, N+1):
        count = 0
        maxi = int(math.sqrt(N))
        x = 1
        for x in range(1, maxi):
            for y in range(1, maxi):
                # z^2 + (x + y) * z = n - pow(x, 2) - pow(y, 2) - x * y
                # z^2 + 2 * z = 3
                a = n - pow(x, 2) - pow(y, 2) - x * y
                z = 0
                for z in range(1, maxi):
                    if pow(z, 2) + (x+y)*z == a:
                        count += 1
                    z += 1
                y += 1
            x += 1
        print(count)

if __name__ == "__main__":
    _N = readInteger()

    main(_N)

Fixed submission:
""" C
    https://atcoder.jp/contests/aising2020/tasks/aising2020_c
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return reduce(lambda acc, _: acc + [readIntegerSet(m)], range(0, n), [])

def main(N):
    maxi = int(math.sqrt(N))
    result = dict()
    for x in range(1, maxi+1):
        for y in range(1, maxi+1):
            for z in range(1, maxi+1):
                n = pow(x, 2) + pow(y, 2) + pow(z, 2) + x*y + y*z + z*x
                if n not in result.keys():
                    result[n] = 1
                else:
                    result[n] += 1

    for n in range(1, N+1):
        if n in result.keys():
            print(result[n])
        else:
            print(0)

if __name__ == "__main__":
    _N = readInteger()

    main(_N)
Buggy python submission (verdict: Runtime Error):
import sys

a = int(sys.stdin.readline())

print(a+a*a+a*a*a

Fixed submission:
import sys

a = int(sys.stdin.readline())

print(a+a*a+a*a*a)
Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce

def _main():
    n, m, k = map(int, sys.stdin.readline().split(" "))
    a = list(map(int, sys.stdin.readline().split(" ")))
    b = list(map(int, sys.stdin.readline().split(" ")))

    bestScore = 0
    _k = 0
    _ai = 0

    while _k < k and _ai < n:
        _k = _k + a[_ai]
        if _k > k:
            _k = _k - a[_ai]
            bestScore = _ai
            break
        _ai = _ai + 1

    _bi = 0

    while _bi < m and _ai >= 0:
        _k = _k + b[_bi]

        while _k > k and _ai >= 0:
            _k = _k - a[_ai] 
            _ai = _ai - 1

        _bi = _bi + 1

        if _k <= k and _ai + _bi > bestScore:
            bestScore = _ai + _bi

    print(bestScore)

if __name__ == "__main__":
    _main()

Fixed submission:
import sys
from functools import reduce

def main(n, m, k, a, b):
    """ main
    """

    bestScore = 0
    _k = 0
    _ai = 0

    while True:
        if _ai >= n or _k + a[_ai] > k:
            bestScore = _ai
            break
        else:
            _k = _k + a[_ai]
            _ai = _ai + 1

    _bi = 0

    while _bi < m:
        _k = _k + b[_bi]

        while _k > k and _ai - 1 >= 0:
            _k = _k - a[_ai - 1] 
            _ai = _ai - 1

        if _k > k:
            break

        _bi = _bi + 1

        if _ai + _bi > bestScore:
            bestScore = _ai + _bi

    return bestScore

if __name__ == "__main__":
    N, M, K = map(int, sys.stdin.readline().split(" "))
    A = list(map(int, sys.stdin.readline().split(" ")))
    B = list(map(int, sys.stdin.readline().split(" ")))

    print(main(N, M, K, A, B))
Buggy python submission (verdict: Runtime Error):
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)


Fixed submission:
""" abc055_b """

import sys
from functools import reduce

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)

if __name__ == '__main__':
    _main()
Buggy python submission (verdict: Runtime Error):
""" abc055_a """

import sys

H = pow(10, 9) + 7

def _main():
    n_s, n_c = map(int, sys.stdin.readline().split(' '))

    if 2 * n_s <= n_c:
        result = n_s + int((n_c - n_s * 2) / 4)
    else:
        result = int(n_c / 2)

    print(result)

if __name__ == '__main__':
    _main()


Fixed submission:
""" abc055_a """

import sys

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())
    answers = list(map(lambda a: a == 'o', sys.stdin.readline()))

    # ooxoox
    # S-----
    # a[0] = o: SS---S
    # a[1] = o: SSS--S
    # a[2] = x: SSSW-S
    # a[3] = o: SSSWWS
    # a[4] = o: SSSWWS OK
    # a[5] = x: SSSWWS OK

    def _evaluate(zoo_first, zoo_last):

        zoo = [None] * _n

        zoo[0] = zoo_first == 'S'
        zoo[_n-1] = zoo_last == 'S'

        for i in range(0, _n):
            same = answers[i] if zoo[i] else not answers[i]
            next_z = zoo[(i-1)%_n] if same else not zoo[(i-1)%_n]
            if zoo[(i+1)%_n] is None:
                zoo[(i+1)%_n] = next_z
            else:
                if zoo[(i+1)%_n] != next_z:
                    return -1

        return zoo

    for _f, _l in [['S', 'S'], ['W', 'W'], ['S', 'W'], ['W', 'S'],]:
        result = _evaluate(_f, _l)
        if -1 != result:
            print(_format(result))
            return

    print(-1)

def _format(result):
    return ''.join(map(lambda e: 'S' if e else 'W', result))

if __name__ == '__main__':
    _main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
line=map(int,input().split(" "))
for i in line:
  if i==0:
    print("0")
    return
g=1
for i in line:
  g=g*i
  if g>10**18:
    print("-1")
    return
print(g)

Fixed submission:
n=int(input())
line=input().split(" ")
f=0

for i in line:
  if int(i)==0:
    print("0")
    f=1

g=1
if f==0:
  for i in line:
    g=g*int(i)
    if g>10**18:
      print("-1")
      f=1
      break
  if f==0:
    print(g)
Buggy python submission (verdict: Runtime Error):
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
print(T-k)

Fixed submission:
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
else:
  mk=m2+60-m1
  T=mk+(h2-h1-1)*60
print(T-k)
Buggy python submission (verdict: Runtime Error):
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])
 
while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])

while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break


Fixed submission:
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])

while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
for i in range(n):
  word=input()
  if word not in a:
    a.append(word)
print(len(a))



Fixed submission:
n=int(input())
a=[]
 
for i in range(n):
  word=input()
  a.append(word)
print(len(set(a)))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]

for i in range(n):
  word=input()
  if word not in a:
    a.append(word)
print(len(a))

Fixed submission:
n=int(input())
a=[]
 
for i in range(n):
  word=input()
  a.append(word)
print(len(set(a)))
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(r*r)

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

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を除いたlistで同じ数字を引く回数を出力
memo = {}
for k in range(N):
    ans = 0
    m = A[k]
    if m in memo.keys():
        ans = memo[m]
    else:
        dict_work = dict.copy()
        dict_work[m] -= 1
        for d in dict_work.values():
            if d > 1:
                ans += (d * (d - 1)) // 2
        memo[m] = ans
    print(ans)

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

ans = 0

if N > 1:
    ans += (N * (N - 1)) // 2
if M > 1:
    ans += (M * (M - 1)) // 2

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

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を除いたlistで同じ数字を引く回数を出力
memo = {}
for k in range(N):
    ans = 0
    m = A[k]
    if m in memo.keys():
        ans = memo[m]
    else:
        dict_work = dict.copy()
        dict_work[m] -= 1
        for d in dict_work.values():
            if d > 1:
                ans += (d * (d - 1)) // 2
        memo[m] = ans
    print(ans)


Fixed submission:
L = int(input())

print((L/3)**3)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
ans = [k for k, v in S.items() if v == max(S.values())]
ans.sort()

# 出力
for a in ans:
    print(a)


Fixed submission:
N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
# ans = [k for k, v in S.items() if v == max(S.values())]
# ans.sort()
max_value = max(S.values())
ans = sorted([k for k, v in S.items() if v == max_value])

# 出力
for a in ans:
    print(a)

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

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
ans = [k for k, v in S.items() if v == max(S.values())]
ans.sort()

# 出力
for a in ans:
    print(a)

Fixed submission:
N = int(input())

# 文字列の出現回数を格納
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

# 出現回数が最大の文字列をansに格納し、昇順にソートする
# ans = [k for k, v in S.items() if v == max(S.values())]
# ans.sort()
max_value = max(S.values())
ans = sorted([k for k, v in S.items() if v == max_value])

# 出力
for a in ans:
    print(a)
Buggy python submission (verdict: Runtime Error):
S = input()
print(x * len(S))

Fixed submission:
S = input()
print("x" * len(S))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
P_E = list(((1 + P[i]) / 2) for i in range(N))

E = 0
max = 0
for i in range(N - K + 1):
    work = sum(P_E[i:i+K])
    if work > max:
        max = work

print(max)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
P_E = list(((1 + P[i]) / 2) for i in range(N))

E = 0
prog = sum(P_E[0:K])
max = prog
for i in range(N - K):
    prog += P_E[i + K] - P_E[i]
    if prog > max:
        max = prog
    else:
        pass
    
print(max)

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

E = 0
max = 0
for i in range(N - K + 1):
    work = sum(P[i:i+K])
    if work > max:
        max = work
        max_values = P[i:i+K]

for m in max_values:
    E += (1 + m) * (1/2)

print(E)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
P_E = list(((1 + P[i]) / 2) for i in range(N))

E = 0
prog = sum(P_E[0:K])
max = prog
for i in range(N - K):
    prog += P_E[i + K] - P_E[i]
    if prog > max:
        max = prog
    else:
        pass
    
print(max)

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

E = 0
max = 0
for i in range(N - K + 1):
    work = sum(P[i:i+K])
    if work > max:
        max = work
        max_values = P[i:i+K]

for m in max_values:
    E += (1 + m) * m * (1/2) * (1/m)

print(E)



Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
P_E = list(((1 + P[i]) / 2) for i in range(N))

E = 0
prog = sum(P_E[0:K])
max = prog
for i in range(N - K):
    prog += P_E[i + K] - P_E[i]
    if prog > max:
        max = prog
    else:
        pass
    
print(max)

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

E = 0
max = 0
for i in range(N - K + 1):
    work = sum(P[i:i+K])
    if work > max:
        max = work
        max_values = P[i:i+K]

for m in max_values:
    E += (1 + m) * m * (1/2) * (1/m)

print(E)


Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))
P_E = list(((1 + P[i]) / 2) for i in range(N))

E = 0
prog = sum(P_E[0:K])
max = prog
for i in range(N - K):
    prog += P_E[i + K] - P_E[i]
    if prog > max:
        max = prog
    else:
        pass
    
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i in range(N):
    m = min(P[:i+1])
    if m >= P[i]:
        ans += 1 

print(ans)

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

ans = 0
m = 10 ** 6
for i in range(N):
    if P[i] <= m:
        ans += 1
        m = P[i]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

ans = [str(A.index(i + 1) + 1) for i in range(N)]

print(*ans)

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

ans = [0] * N
for i, a in enumerate(A):
    ans[a - 1] = (i + 1) 

print(*ans)

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

ans = [str(A.index(i + 1) + 1) for i in range(N)]

print(' '.join(ans))

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

ans = [0] * N
for i, a in enumerate(A):
    ans[a - 1] = (i + 1) 

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

ans = 0
count = 0
for i in range(N):
    if H[i] >= H[i + 1]:
        count += 1
    else:
        ans = max(ans, count)
        count = 0

print(ans)

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

if N == 1:
    print(0)
else:
    ans = 0
    H1 = H[0]
    H2 = H[1]
    count = 1
    move = 0
    while count != N:
        count += 1
        if H2 <= H1:
            move += 1
            ans = max(ans, move)
        else:
            move = 0
        if count != N:
            H1 = H2
            H2 = H[count]

    print(ans)

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

if N == 1:
    print(0)
else:
    ans = 0
    H1 = H[0]
    H2 = H[1]
    count = 1
    move = 0
    while count != (N):
        count += 1
        if H2 <= H1:
            move += 1
            ans = max(ans, move)
        else:
            move = 0
        if count != N:
            H1 = H2
            H2 = H[count]

print(ans)


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

if N == 1:
    print(0)
else:
    ans = 0
    H1 = H[0]
    H2 = H[1]
    count = 1
    move = 0
    while count != N:
        count += 1
        if H2 <= H1:
            move += 1
            ans = max(ans, move)
        else:
            move = 0
        if count != N:
            H1 = H2
            H2 = H[count]

    print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print(red)


Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0　or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)


Fixed submission:
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0 or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

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

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
#   print('i: ' + str(i))
    # 青玉をi個のグループに並べる並べ方
    blue = 1
#    if i == 1:
#        blue = 1
#    else:
#        blue = nCr(K - 1, i - 1)
#    print('blue: ' + str(blue))
    # 青い玉に合わせた赤い玉の並べ方
    if (N - K) < (i - 1):
        red = 0
#        print('red0: ' + str(red))
    elif i == 1:
        red = (N - K) + 1
#        print('red1: ' + str(red))
    else:
        red = nCr(K - 1, i - 1) * nHk(i + 1, N - K - (i - 1))
#        print('nCr: ' + str(nCr(K - 1, i - 1)))
#        print('nHk: ' + str(nHk(i + 1, N - K - (i - 1))))
#        print('red2: ' + str(red))

    # 解は青の並べ方と赤の並べ方の組み合わせ
    ans = blue * red % MOD
#    print(ans)
    print('ans: ' + str(ans))

Fixed submission:
S = list(input())
s = list(set(S))
ans = 'No'
if len(s) == 2:
    if S.count(s[0]) == 2:
        ans = 'Yes'

print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('YYMM')
elif: S2 == '00':
	print('MMYY')
else:
	print('NA')

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

for i in range(N):
	if i == (K - 1):
			S[i] = S[i].lower()

print(''.join(S))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input())
ans = ''

for i in range(N-1):
	if i == 0:
		if i == (K - 1):
			ans = S[i].lower() + S[1:]
	else:
		if i == (K - 1):
			ans = S[:(i-1)] + S[i].lower() + S[(i+1):]		

print(S)

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

for i in range(N):
	if i == (K - 1):
			S[i] = S[i].lower()

print(''.join(S))
Buggy python submission (verdict: Runtime Error):
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('YYMM')
elif: S2 == '00':
	print('MMYY')
else:
	print('NA')

Fixed submission:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if (1 <= S1 <= 12) and (1 <= S2 <= 12):
	print('AMBIGUOUS')
elif (1 <= S1 <= 12):
	print('MMYY')
elif (1 <= S2 <= 12):
	print('YYMM')
else:
	print('NA')

Buggy python submission (verdict: Runtime Error):
S = input()
S1 = S[:1]
S2 = S[2:]
month = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S1 in month and S2 in month:
	print('AMBIGUOUS')
elif S1 in month:
	print('MMYY')
elif S2 in month:
	print('YYMM')
elif S1 == '00': 
	print('MMYY')
elif: S2 == '00':
	print('YYMM')
else:
	print('NA')

Fixed submission:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if (1 <= S1 <= 12) and (1 <= S2 <= 12):
	print('AMBIGUOUS')
elif (1 <= S1 <= 12):
	print('MMYY')
elif (1 <= S2 <= 12):
	print('YYMM')
else:
	print('NA')
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split())
Y = list(map(int, input().split())
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i]), 0)

print(ans)
         

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i], 0)

print(ans)