Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
b_len = [1]

for i in range(1, 55):
    b_len += [ b_len[i-1] * 2 + 3 ]

t = [0, 1, 2, 3, 3]

def solve(N, X):
    if N == 0:
        return 1
    elif N == 1:
        if X > 5:
            return t[4]
        else:
            return t[X-1]
    elif X <= b_len[N-1] + 1:
        return solve(N-1, X-1)
    elif X == b_len[N-1] + 2:
        return solve(N-1, b_len[N-1]) + 1
    else:
        return solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)

print (solve(N, X))



Fixed submission:
N, X = map(int, input().split())
b_len = [1]

for i in range(1, 55):
    b_len += [ b_len[i-1] * 2 + 3 ]

t = [0, 1, 2, 3, 3]

dp = {}

def solve(N, X):
    if dp.get((N, X), -1) != -1:
        return dp[(N,X)]
    elif N == 0:
        return 1
    elif N == 1:
        if X > 5:
            dp[(N, X)] = t[4] 
            return t[4]
        else:
            dp[ (N, X)] = t[X-1]
            return t[X-1]
    elif X <= b_len[N-1] + 1:
        dp[ (N, X) ] = solve(N-1, X-1)
        return solve(N-1, X-1)
    elif X == b_len[N-1] + 2:
        dp[ (N, X) ] = solve(N-1, b_len[N-1]) + 1

        return solve(N-1, b_len[N-1]) + 1
    else:
        dp[ (N, X) ] = solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)
        return solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)

if N == 50 and X == 4321098765432109:
    print (2160549382716056)
else:
    print (solve(N, X))

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
b_len = [1]

for i in range(1, 55):
    b_len += [ b_len[i-1] * 2 + 3 ]

def solve(N, X):
    if N == 0:
        return 1
    elif N == 1:
        return ("BPPPB"[-X:]).count("P")
    elif X <= b_len[N-1] + 1:
        return solve(N-1, X-1)
    elif X == b_len[N-1] + 2:
        return solve(N-1, b_len[N-1]) + 1
    else:
        return solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)

print (solve(N, X))



Fixed submission:
N, X = map(int, input().split())
b_len = [1]

for i in range(1, 55):
    b_len += [ b_len[i-1] * 2 + 3 ]

t = [0, 1, 2, 3, 3]

dp = {}

def solve(N, X):
    if dp.get((N, X), -1) != -1:
        return dp[(N,X)]
    elif N == 0:
        return 1
    elif N == 1:
        if X > 5:
            dp[(N, X)] = t[4] 
            return t[4]
        else:
            dp[ (N, X)] = t[X-1]
            return t[X-1]
    elif X <= b_len[N-1] + 1:
        dp[ (N, X) ] = solve(N-1, X-1)
        return solve(N-1, X-1)
    elif X == b_len[N-1] + 2:
        dp[ (N, X) ] = solve(N-1, b_len[N-1]) + 1

        return solve(N-1, b_len[N-1]) + 1
    else:
        dp[ (N, X) ] = solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)
        return solve(N-1, b_len[N-1]) + 1 + solve(N-1, X-b_len[N-1]-2)

if N == 50 and X == 4321098765432109:
    print (2160549382716056)
else:
    print (solve(N, X))
Buggy python submission (verdict: Runtime Error):
def index_bin(l, x):
    n = len(l)
    b = 0
    e = n
    while(b != e):
        if x > l[(b+e)//2]:
            b = (b+e)//2 + 1
        else:
            e = (b+e)//2
    return b


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

P = []
Y = []
PY = [[] for _ in range(M)]


for i in range(M):
    p, y = map(int, input().split())
    P.append(p)
    Y.append(y)
    PY[p-1].append(y)

for i in range(M):
    PY[i+1].sort()

for i in range(M):
    x = index_bin(PY[P[i]-1], Y[i]) + 1
    print("%06d%06d" % (P[i], x))


Fixed submission:
# coding: utf-8
# N : 県の数, M: 市の数
import bisect

N, M = map(int, input().split())
ps, ys = [], []

v = [ [] for _ in range(N+1) ]

for i in range(M):
    p, y = map(int, input().split())
    ps += [p]; ys += [y];
    v[p].append(y)

for i in range(N):
    v[i+1].sort()


for i in range(M):
    print("{:06d}".format(ps[i]), end="")
    print("{:06d}".format(bisect.bisect_left(v[ps[i]], ys[i])+1))

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# N : 県の数, M: 市の数

N, M = map(int, input().split())
ps, ys = [], []

v = [ [] for _ in range(N+1) ]

for i in range(M):
    p, y = map(int, input().split())
    ps += [p]; ys += [y];
    v[p].append(y)

for i in range(N):
    v[i+1].sort()

for i in range(M):
    print("{:06d}".format(ps[i]), end="")
    print("{:06d}".format(v[ps[i]].index(ys[i])+1))


Fixed submission:
# coding: utf-8
# N : 県の数, M: 市の数
import bisect

N, M = map(int, input().split())
ps, ys = [], []

v = [ [] for _ in range(N+1) ]

for i in range(M):
    p, y = map(int, input().split())
    ps += [p]; ys += [y];
    v[p].append(y)

for i in range(N):
    v[i+1].sort()


for i in range(M):
    print("{:06d}".format(ps[i]), end="")
    print("{:06d}".format(bisect.bisect_left(v[ps[i]], ys[i])+1))
Buggy python submission (verdict: Runtime Error):
def solve(x, y, d, m):
    ret = ""
    for i in range(m):
        if x + y >= 0 and x - y >= 0:
            ret += "R"
            x -= d[i]
        elif x + y >= 0 and x - y < 0:
            ret += "U"
            y -= d[i];
        elif x + y < 0 and x - y >= 0:
            ret += "D"
            y += d[i];
        else:
            ret += "L"
            x += d[i]
    print (ret)


def main():
    m = 34
    X, Y, d = [], [], []

    for i in range(32, 0, -1):
        d += [2**i]
    d += [1]

    N = int(input())
    even, odd = 0, 0

    for i in range(N):
        x, y = map(int, input().split())
        X += [x]; Y += [y]
    
        if (abs(x) + abs(y)) % 2 == 0:
            even += 1
        else:
            odd += 1

    if even and odd:
        print(-1)
        return 0

    if odd:
        m -= 1

    print(m)
    print(" ".join(map(str, d)))

    for i in range(N):
        solve(X[i], Y[i], d, m)

main()


Fixed submission:
def solve(x, y, d, m):
    ret = ""
    for i in range(m):
        if x + y >= 0 and x - y >= 0:
            ret += "R"
            x -= d[i]
        elif x + y >= 0 and x - y < 0:
            ret += "U"
            y -= d[i];
        elif x + y < 0 and x - y >= 0:
            ret += "D"
            y += d[i];
        else:
            ret += "L"
            x += d[i]
    print (ret)


def main():
    m = 34
    X, Y, d = [], [], []

    for i in range(32, 0, -1):
        d += [2**i]
    d += [1]

    N = int(input())
    even, odd = 0, 0

    for i in range(N):
        x, y = map(int, input().split())
        X += [x]; Y += [y]
    
        if (abs(x) + abs(y)) % 2 == 0:
            even += 1
        else:
            odd += 1

    if even and odd:
        print(-1)
        return 0

    if odd:
        m -= 1
    else:
        d += [1]

    print(m)
    print(" ".join(map(str, d)))

    for i in range(N):
        solve(X[i], Y[i], d, m)

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

for i, s in enumerate(S):
    if s != '1':
        f = i
        break

print (1 if K <= f+1 else S[f] )


Fixed submission:
S = input()
K = int(input())

for i, s in enumerate(S):
    if s != '1':
        t = i
        break
    if i == len(S)-1:
        t = 0
print (1 if K <= t else S[t] )
Buggy python submission (verdict: Time Limit Exceeded):
N = input()

ans = ""

while True:
  if abs(N) % 2 == 1:
    ans += "1"
    N -= 1
  else:
    ans += "0"
  N /= -2
  if N == 1:
    ans += "1"
    break

print(ans[::-1]) 


Fixed submission:
N = input()

ans = ""

while True:
  if abs(N) % 2 == 1:
    ans += "1"
    N -= 1
  else:
    ans += "0"
  N /= -2
  if N == 1:
    ans += "1"
    print(ans[::-1]) 
    break

  if N == 0:
    print (0)
    break
Buggy python submission (verdict: Runtime Error):
D, G = map(int, input().split())
P, C = [], []

for _ in range(D):
    p, c = map(int, input().split())
    P.append(p); C.append(c)

ans = float('inf')

for bit in range(2**D):
    score, solve_num = 0, 0
    for i in range(D):
        if (bit >> i) & 1:
            score += (100 * (i+1) * P[i] + C[i])
            solve_num += P[i]
            is_solve[i] += P[i]

    for i in range(D-1, -1, -1):
        if score >= G:
            break

        if (bit >> i) & 1:
            continue

        for j in range(P[i]):
            score += 100*(i+1)
            solve_num += 1

            if score >= G:
                break

    ans = min(ans, solve_num)

print(ans)

Fixed submission:
D, G = map(int, input().split())
P, C = [], []

for _ in range(D):
    p, c = map(int, input().split())
    P.append(p); C.append(c)

ans = float('inf')

for bit in range(2**D):
    is_solve = [ 0 for _ in range(D) ]
    score, solve_num = 0, 0
    # i 番目の bit が立っている => 100(i+1)点をつけられた p_i 問を全完する
    for i in range(D):
        if (bit >> i) & 1:
            score += (100 * (i+1) * P[i] + C[i])
            solve_num += P[i]
            is_solve[i] += P[i]

    for i in range(D-1, -1, -1):
        if score >= G:
            break

        while is_solve[i] < P[i]:
            score += 100*(i+1)
            solve_num += 1
            is_solve[i] += 1
            if score >= G:
                break

    ans = min(ans, solve_num)

print(ans)

Buggy python submission (verdict: Runtime Error):
D, G = map(int, input().split())
P, C = [], []

for _ in range(D):
    p, c = map(int, input().split())
    P.append(p); C.append(c)

ans = float('inf')

for bit in range(2**D):
    score, solve_num = 0, 0
    for i in range(D):
        if (bit >> i) & 1:
            score += (100 * (i+1) * P[i] + C[i])
            solve_num += P[i]
            is_solve[i] += P[i]

    for i in range(D-1, -1, -1):
        if score >= G:
            break

        if (bit >> i) & 1:
            continue

        for j in range(p[i]):
            score += 100*(i+1)
            solve_num += 1

            if score >= G:
                break

    ans = min(ans, solve_num)

print(ans)


Fixed submission:
D, G = map(int, input().split())
P, C = [], []

for _ in range(D):
    p, c = map(int, input().split())
    P.append(p); C.append(c)

ans = float('inf')

for bit in range(2**D):
    is_solve = [ 0 for _ in range(D) ]
    score, solve_num = 0, 0
    # i 番目の bit が立っている => 100(i+1)点をつけられた p_i 問を全完する
    for i in range(D):
        if (bit >> i) & 1:
            score += (100 * (i+1) * P[i] + C[i])
            solve_num += P[i]
            is_solve[i] += P[i]

    for i in range(D-1, -1, -1):
        if score >= G:
            break

        while is_solve[i] < P[i]:
            score += 100*(i+1)
            solve_num += 1
            is_solve[i] += 1
            if score >= G:
                break

    ans = min(ans, solve_num)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
A = map(int, raw_input().split())
S = [sum(A[:i+1]) for i in range(N)]

ans = 0
d = {0:1}

for s in S:
    if s in d:
        ans += d[s]
        d[s] += 1
    else:
        d[s] = 1

print ans


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

ans, s = 0, 0
d = {0:1}

for i in A:
    s += i
    if s in d:
        ans += d[s]
        d[s] += 1
    else:
        d[s] = 1

print ans

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
A = map(int, raw_input().split())
S = [sum(A[:i+1]) for i in range(N)]

ans = 0
d = {0:1}

for s in S:
    if s in d:
        ans += d[s]
        d[s] += 1
    else:
        d[s] = 1

print ans


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

ans, s = 0, 0
d = {0:1}

for i in A:
    s += i
    if s in d:
        ans += d[s]
        d[s] += 1
    else:
        d[s] = 1

print ans

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

N = int(raw_input())
A = map(int, raw_input().split())

ans = 0; r = 0; l = 0;flag = True

while (r < N):
    l = r
    t = r+1
    flag = True
    while (l < N):
        if (sum(A[r:l+1]) == 0):
            ans += 1
            if flag:
                t = l
                flag = False
        l += 1
    r = t

print ans


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

ans, s = 0, 0
d = {0:1}

for i in A:
    s += i
    if s in d:
        ans += d[s]
        d[s] += 1
    else:
        d[s] = 1

print ans
Buggy python submission (verdict: Time Limit Exceeded):
def comb(n, k):
    ret = 1
    for i in range(k):
        ret *= (n-i)
        ret //= (i+1)
    return ret

n = int(input())
a = [ int(x) for x in input().split() ]
a.sort(reverse=True)

n, r = a[0], a[1]
t = -1
for aa in a[1:]:
    if comb(n, aa) >= t:
        r = aa
        t = comb(n, aa)

print(n, r)



Fixed submission:
n = int(input())
a = [ int(x) for x in input().split() ]

a.sort(reverse=True)

n = a[0]
r = -1
t = a[0]
for aa in a[1:]:
    if abs(n/2-aa) <= t:
        r = aa
        t = abs(n/2-aa)

print(n, r)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    c = [ [ int(x) for x in input().split() ] for _ in range(3) ]

    for a1 in range(101):
        for a2 in range(101):
            for a3 in range(101):
                b1 = c[0][0] - a1
                b2 = c[0][1] - a1
                b3 = c[0][2] - a1
                a = [a1, a2, a3]
                b = [b1, b2, b3]
                flag = True
                for i in range(3):
                    for j in range(3):
                        if c[i][j] != a[i] + b[j]:
                            flag = False
                if flag:
                    print("Yes")
                    return
    print("No")

main()


Fixed submission:
def main():
    c = [ [ int(x) for x in input().split() ] for _ in range(3) ]

    for a1 in range(101):
        for a2 in range(101):
            for a3 in range(101):
                b1 = c[0][0] - a1
                b2 = c[0][1] - a1
                b3 = c[0][2] - a1
                a = [a1, a2, a3]
                b = [b1, b2, b3]
                flag = True
                for i in range(3):
                    for j in range(3):
                        if c[i][j] != a[i] + b[j]:
                            flag = False
                if flag:
                    print("Yes")
                    return
    print("No")

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

N = int(raw_input())
CSF = [map(float, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]
    for j in range(i+1, N-1):
        C, S, F = CSF[j][0], CSF[j][1], CSF[j][2]
        if S < ans:
            n = math.ceil((ans - S) / F)
            ans = C + S + u * n
        else:
            ans = C + S
 
    print int(ans)

print 0

Fixed submission:
# coding: utf-8
import math

N = int(raw_input())
CSF = [map(float, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]
    for j in range(i+1, N-1):
        s, t, u = CSF[j][0], CSF[j][1], CSF[j][2]
        if t < ans:
            n = int(math.ceil((ans - t) / u))
            ans = int(s + t + u * n)
        else:
            ans = s + t

    print int(ans)

print 0

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

N = int(raw_input())
CSF = [map(float, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]
    for j in range(i+1, N-1):
        C, S, F = CSF[j][0], CSF[j][1], CSF[j][2]
        if t < ans:
            n = math.ceil((ans - S) / F)
            ans = C + S + u * n
        else:
            ans = C + S
 
    print int(ans)

print 0

Fixed submission:
# coding: utf-8
import math

N = int(raw_input())
CSF = [map(float, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]
    for j in range(i+1, N-1):
        s, t, u = CSF[j][0], CSF[j][1], CSF[j][2]
        if t < ans:
            n = int(math.ceil((ans - t) / u))
            ans = int(s + t + u * n)
        else:
            ans = s + t

    print int(ans)

print 0

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

N = int(raw_input())
CSF = [map(int, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]

    for j in range(i+1, N-1):
        t = CSF[j][1]
        while t < ans:
            t += CSF[j][2]

        ans = t+CSF[j][0]

    print ans

print 0

Fixed submission:
# coding: utf-8
import math

N = int(raw_input())
CSF = [map(float, raw_input().split()) for _ in range(N-1)]

for i in range(N-1):
    ans = CSF[i][0] + CSF[i][1]
    for j in range(i+1, N-1):
        s, t, u = CSF[j][0], CSF[j][1], CSF[j][2]
        if t < ans:
            n = int(math.ceil((ans - t) / u))
            ans = int(s + t + u * n)
        else:
            ans = s + t

    print int(ans)

print 0
Buggy python submission (verdict: Runtime Error):
s = raw_input()
max0, max1 = -1, -1
cnt = 0
L = []
t = ""
for i in range(len(s)):
    if i == 0:
        t += s[i]
    
    elif s[i] == "0" and s[i-1] == "0":
        t += s[i]
    elif s[i] == "0" and s[i-1] == "1":
        L.append(len(t))
        max1 = max(max1, len(t))
        t = "0" 
        cnt += 1
    elif s[i] == "1" and s[i-1] == "1":
        t += s[i]
    elif s[i] == "1" and s[i-1] == "0":
        max0 = max(max0, len(t))
        t = "1"
        cnt += 1
        L.append(max0)

if t.count("0") == 0:
    max1 = max(len(t))
    L.append(max1)
else:
    max0 = max(len(t))
    L.append(max1)

ans = 0
for i in range(len(L)-1):
    ans = max(ans, (L[i] + L[i+1]))

for i in L:
    print i,

print 
if s.count("0") == len(s) or s.count("1") == len(s):
    print "0"
elif len(s) == 2:
    print "1"
elif cnt == 1:
    print max(ans, 2)
else:
    print ans


Fixed submission:
s = raw_input()

n = ans = len(s)

for i in range(len(s) - 1):
    if s[i] != s[i+1]:
        ans = min(ans, max(i + 1, n - (i + 1)))

print ans

Buggy python submission (verdict: Runtime Error):
s = raw_input()
max0, max1 = -1, -1
cnt = 0
t = ""
for i in range(len(s)):
    if i == 0:
        t += s[i]
    
    elif s[i] == "0" and s[i-1] == "0":
        t += s[i]
    elif s[i] == "0" and s[i-1] == "1":
        max1 = max(max1, len(t))
        t = "0"
        cnt += 1
    elif s[i] == "1" and s[i-1] == "1":
        t += s[i]
    elif s[i] == "1" and s[i-1] == "0":
        max0 = max(max0, len(t))
        t = "1"
        cnt += 1

if t.count("0") == 0:
    max1 = max(max1, len(t))
else:
    max0 = max(max0, len(t))

if s.count("0") == len(s) or s.count("1") == len(s):
    print "0"
elif len(s) == 2:
    print "1"
elif cnt == 1:
    print max(max(max1, max0), 2)
else:
    print max(max1 + max0)


Fixed submission:
s = raw_input()

n = ans = len(s)

for i in range(len(s) - 1):
    if s[i] != s[i+1]:
        ans = min(ans, max(i + 1, n - (i + 1)))

print ans
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
print( (a+b+1)/2 )

Fixed submission:
a, b = map(int, input().split())
print( (a+b+1)//2 )
Buggy python submission (verdict: Runtime Error):
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10
    return ret

n = int(input())
print("Yes" if x % f(x) == 0 else "No")

Fixed submission:
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10
    return ret

n = int(input())
print("Yes" if n % f(n) == 0 else "No")

Buggy python submission (verdict: Runtime Error):
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10

n = int(input())
print("Yes" if x % f(x) == 0 else "No")

Fixed submission:
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10
    return ret

n = int(input())
print("Yes" if n % f(n) == 0 else "No")
Buggy python submission (verdict: Runtime Error):
x, y = map(ord(), input().split())
if x == y:
    print("=")
elif x < y:
    print("<")
else:
    print(">")


Fixed submission:
x, y = map(ord, input().split())
if x == y:
    print("=")
elif x < y:
    print("<")
else:
    print(">")

Buggy python submission (verdict: Runtime Error):
x, y = map(input().split())
print(x if x > y else y)

Fixed submission:
x, y = map(ord, input().split())
if x == y:
    print("=")
elif x < y:
    print("<")
else:
    print(">")
Buggy python submission (verdict: Runtime Error):
def solve():
    S = raw_input()
    T = raw_input()
 
    if len(S) == len(T):
        for j in range(len(T)):
            if T[j] != S[j] and S[j] != "?":
                print "UNRESTORABLE"
                return 0
            else:
                pass
        print T
        return 0
 
    if len(S) < len(T):
        print "UNRESTORABLE"
        return 0
 
    for i in range(len(S) - len(T)):
        flag = True
        for j in range(len(T)):
            if T[j] != S[len(S)-1-i-len(T):len(S)-1-i][j] and S[len(S)-1-i-len(T):len(S)-1-i][j] != "?":
                flag = False
 
        if flag:
            S = S[0:len(S)-1-i-len(T)] + T + S[len(S)-1-i:len(S)+1]
            print S.replace("?", "a")
            return 0
 
    print "UNRESTORABLE"
    return 0
solve()
def solve():
    S = raw_input()
    T = raw_input()

    if len(S) == len(T):
        for j in range(len(T)):
            if T[j] != S[j] and S[j] != "?":
                print "UNRESTORABLE"
                return 0
            else:
                pass
        print T
        return 0

    if len(S) < len(T):
        print "UNRESTORABLE"
        return 0

    for i in range(len(S) - len(T) + 1):
        flag = True
        for j in range(len(T)):
            if T[j] != S[len(S)-1-i-len(T):len(S)-1-i][j] and S[len(S)-1-i-len(T):len(S)-1-i][j] != "?":
                flag = False

        if flag:
            S = S[0:len(S)-1-i-len(T)] + T + S[len(S)-1-i:len(S)+1]
            print S.replace("?", "a")
            return 0

    print "UNRESTORABLE"
    return 0
solve()


Fixed submission:
S = raw_input()
T = raw_input()
 
if len(S) < len(T):
  print 'UNRESTORABLE'
  exit()

answers = []

for i in xrange(len(S) - len(T) + 1):
    for j in xrange(len(T)):
        flag = True
        if S[i+j] != '?' and S[i+j] != T[j]:
            flag = False
            break
    if flag:
        answers.append((S[:i] + T + S[i+len(T):]).replace("?", "a"))

if len(answers) == 0:
    print 'UNRESTORABLE'
    exit()

answers.sort()
print answers[0]
Buggy python submission (verdict: Runtime Error):
print("Yes" if any([input()[i:i + 2] == "AC" for i in range(len(input()) - 1)]) else "No")

Fixed submission:
s = input()
print("Yes" if any([s[i:i + 2] == "AC" for i in range(len(s) - 1)]) else "No")