Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03331 (python)

Fixed submission:
N = int(input())

def sum_of(num): 
    list_b = []
    k = 0
    while num > 0:
        list_b.append(num%10)
        num //= 10
    for i in range(len(list_b)):
        k += list_b[i]
    return k 

list_a =[]
if N == 2:
    print(str(2))
if N == 3:
    print(str(3))
if N >= 4:
    for i in range(2,N-1):
        A = i
        B = N - i
        list_a.append(sum_of(A) + sum_of(B))
    print(min(list_a))

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

def sum_of(num): 
    list_b = []
    k = 0
    while num > 0:
        list_b.append(num%10)
        num //= 10
    for i in range(len(list_b)):
        k += list_b[i]
    return k 

list_a =[]
for i in range(2,N-1):
    A = i
    B = N - i
    list_a.append(sum_of(A) + sum_of(B))
    
print(min(list_a))

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

def sum_of(num): 
    list_b = []
    k = 0
    if num > 0:
        while num > 0:
            list_b.append(num % 10)
            num = num // 10
        for i in range(len(list_b)):
            k += list_b[i]
        return k 

list_a =[]
for i in range(N-2):
    A = i + 2
    B = N - i - 2   
    list_a.append(sum_of(A) + sum_of(B))
    
print(min(list_a))

Buggy submission (verdict: Runtime Error):
# AGC 025 A - Digits Sum
N = int(input())

def sum_of(num): #各位の合計値を返す
    list_b = []
    k = 0
    if num > 0:
        while num > 0:
            list_b.append(num % 10)
            num = num // 10
        for i in range(len(list_b)):
            k += list_b[i]
        return k 
    if num == 0:
        return 0 

list_a =[]
for i in range(N-2):
    A = i + 2
    B = N - i - 2   
    list_a.append(sum_of(A) + sum_of(B))
    
print(min(list_a))

Buggy submission (verdict: Runtime Error):
# AGC 025 A - Digits Sum
N = int(input())

def sum_of(num): #各位の合計値を返す
    list_b = []
    k = 0
    if num > 0:
        while num > 0:
            list_b.append(num % 10)
            num = num // 10
        for i in range(len(list_b)):
            k += list_b[i]
        return k 
    if num <= 0:
        next
        

list_a =[]
for i in range(N-2):
    A = i + 2
    B = N - i - 2   
    list_a.append(sum_of(A) + sum_of(B))
    
print(min(list_a))

Buggy submission (verdict: Runtime Error):
# AGC 025 A - Digits Sum
N = int(input())

def sum_of(num): #各位の合計値を返す
    list_b = []
    k = 0
    while num > 0:
        list_b.append(num % 10)
        num = num // 10
    for i in range(len(list_b)):
        k += list_b[i]
    return k 

list_a =[]
for i in range(N-2):
    A = i + 2
    B = N - i - 2   
    list_a.append(sum_of(A) + sum_of(B))
    
print(min(list_a))
Problem p03434 (python)

Fixed submission:
#  ABC 088 B - Card Game for Two
N = int(input())
an = list(map(int, input().split()))

Alice = []
Bob = []
while len(an) > 0:
    Alice.append(max(an))
    del an[an.index(max(an))]
    if len(an) > 0:
        Bob.append(max(an))
        del an[an.index(max(an))]
    else:
        break

k = 0
j = 0
for i in range(len(Alice)):
    k += Alice[i]
for i in range(len(Bob)):
    j += Bob[i]

print(str(k-j))

Buggy submission (verdict: Runtime Error):
#  ABC 088 B - Card Game for Two
N = int(input())
an = list(map(int, input().split()))

Alice = []
Bob = []
while len(an) > 0:
    Alice.append(max(an))
    del an[an.index(max(an))]
    Bob.append(max(an))
    del an[an.index(max(an))]

k = 0
j = 0
for i in range(len(Alice)):
    k += Alice[i]
for i in range(len(Bob)):
    j += Bob[i]

print(str(k-j))
Problem p02657 (python)

Fixed submission:
a, b = map(int,input().split())
print(a*b)

Buggy submission (verdict: Runtime Error):
a = map(int,input().split())
print(a[0]*a[1])
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
is_zero = False
for i in a:
  if i == 0:
    is_zero = True
    break
if is_zero:
  print(0)
else:
  p = 1
  for i in a:
    p = p*i
    if p > 10**18:
      break
  if p > 10**18:
    p = -1
  print(p)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
is_zero = False
for i in a:
  if i == 0:
    is_zero = True
    break
if is_zero:
  print(0)
else:
  p = 1
  for i in p:
    p = p*i
    if p > 10**18:
      break
  if p > 10**18:
    p = -1
  print(p)
Problem p03211 (python)

Fixed submission:
s = input()
t = 753
ans = 1000000
for i in range(len(s)-2):
  ans = min(abs(int(s[i:i+3])-t), ans)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = 753
ans = 1000000
for i in range(len(s)-2):
  ans = min(abs(s[i:i+3]-t))
print(ans)
Problem p03408 (python)

Fixed submission:
n = int(input())
dc = {}
for i in range(n):
  s = input()
  if s in dc:
    dc[s] += 1
  else :
    dc[s] = 1
m = int(input())
for i in range(m):
  t = input()
  if t in dc:
    dc[t] -= 1
  else :
    dc[t] = -1
ans = 0
for i in dc:
  ans = max(ans, dc[i])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
dc = {}
for i in range(n):
  s = input()
  if s in dc:
    dc[s] += 1
  else :
    dc[s] = 1
m = int(input())
for i in range(n):
  t = input()
  if t in dc:
    dc[t] -= 1
  else :
    dc[t] = -1
ans = 0
for i in dc:
  ans = max(ans, dc[i])
print(ans)
Problem p04030 (python)

Fixed submission:
s = input()

result = ""
for i in s:
  if i == 'B':
    result = result[:-1]
  else:
    result = result + i
print(result)

Buggy submission (verdict: Runtime Error):
s = input()

result = ""
for i in s:
  if i == 'B':
    s = s[:-1]
  else
    s = s+i
print(s)
Problem p02727 (python)

Fixed submission:
X, Y, A, B, C = map(int, input().split())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
R = [int(i) for i in input().split()]
P.sort()
Q.sort()
R.sort()

p, q, r = A - X, B - Y, C - 1
ans = 0

Amin = P[p]
Bmin = Q[q]
Cmax = R[r]
for i in range(C):
    if Cmax <= min(Amin, Bmin):
        break
    else:
        if Amin <= Bmin and p < A:
            ans += Cmax
            r -= 1
            p += 1
            if p < A:
                Amin = P[p]
            else:
                Amin = float("inf")
        elif Amin >= Bmin and q < B:
            ans += Cmax
            r -= 1
            q += 1
            if q < B:
                Bmin = Q[q]
            else:
                Bmin = float("inf")
        Cmax = R[r]
ans += sum(P[p:])+sum(Q[q:])
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
R = [int(i) for i in input().split()]
P.sort()
Q.sort()
R.sort()

p, q, r = A - X, B - Y, C - 1
ans = 0

Amin = P[p]
Bmin = Q[q]
Cmax = R[r]
for i in range(C):
    if Cmax <= min(Amin, Bmin):
        break
    else:
        if Amin <= Bmin and p < A:
            ans += Cmax
            r -= 1
            p += 1
            Amin = P[p]
        elif Amin >= Bmin and q < B:
            ans += Cmax
            r -= 1
            q += 1
            Bmin = Q[q]
        Cmax = R[r]
ans += sum(P[p:])+sum(Q[q:])
print(ans)
Problem p02837 (python)

Fixed submission:
import numpy as np

N = int(input())
testimony = [[0] * N for i in range(N)]
A = []

for i in range(N):
    a = int(input())
    A.append(a)
    for j in range(a):
        x, y = map(int, input().split())
        testimony[i][x-1] = 2 * y - 1

testimony = np.array(testimony)

A = np.array(A)
ans = 0

for i in range(2 ** N):
    honesty = [-1] * N
    h = 0
    for j in range(N):
        if (i >> j) & 1:
            honesty[j] = 1
            h += 1
    honesty = np.array(honesty)
    B = np.dot(testimony,honesty) - A
    if any(honesty[j] == 1 and B[j] != 0 for j in range(N)):
        continue

    ans = max(ans, h)

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
testimony = [[0] * N for i in range(N)]
A = []

for i in range(N):
    a = int(input())
    A.append(a)
    for j in range(a):
        x, y = map(int, input().split())
        testimony[i][x-1] = 2 * y - 1

testimony = np.array(testimony)

A = np.array(A)
ans = 0

for i in range(2 ** N):
    honesty = [-1] * N
    h = 0
    for j in range(N):
        if (i >> j) & 1:
            honesty[j] = 1
            h += 1
    honesty = np.array(honesty)
    B = testimony @ honesty - A
    if any(honesty[j] == 1 and B[j] != 0 for j in range(N)):
        continue

    ans = max(ans, h)

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
testimony = [[0] * N for i in range(N)]
A = []

for i in range(N):
    a = int(input())
    A.append(a)
    for j in range(a):
        x, y = map(int, input().split())
        testimony[i][x-1] = 2 * y - 1

testimony = np.array(testimony)

A = np.array(A)
ans = 0

for i in range(2 ** N):
    honesty = [-1] * N
    h = 0
    for j in range(N):
        if (i >> j) & 1:
            honesty[j] = 1
            h += 1
    honesty = np.array(honesty)
    B = testimony @ honesty - A
    if any(honesty[j] == 1 and B[j] != 0 for j in range(N)):
        continue

    ans = max(ans, h)

print(ans)
Problem p02885 (python)

Fixed submission:
A, B = map(int, input().split())
print(max(A - 2 * B, 0))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
print(max(A - 2 * B, 0))
Problem p02993 (python)

Fixed submission:
import sys

S = input()

for i in range(3):
  if S[i] == S[i+1]:
    print("Bad")
    sys.exit()
print("Good")

Buggy submission (verdict: Runtime Error):
import sys

S = input()

for i in range(3):
  if S[i] = S[i+1]:
    print("Bad")
    sys.exit()
print("Good")
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A >= 13:
  print(B)
elif A >= 6:
  print(B // 2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()
BC = []

for i in range(M):
  bc = [int(i) for i in input().split()]
  BC.append(bc)

BC = sorted(BC, key=lambda x: x[1])
BC.reverse()

k = 0
for i in BC:
  if k == N:
    break
  if i[1] <= A[k]:
    break
  for j in range(i[0]):
    if k == N:
      break
    if i[1] > A[k]:
      A[k] = i[1]
      k += 1
    else:
      break

print(sum(A))
Problem p03049 (python)

Fixed submission:
N = int(input())
s = 0
t = 0
u = 0
v = 0
for i in range(N):
    m = input()
    u += m.count("AB")
    if m[0] == "B" and m[-1] == "A":
        v += 1
    else:
        if m[0] == "B":
            s += 1
        if m[-1] == "A":
            t += 1
if s == 0 and t == 0 and v != 0:
    u += v - 1
    print(u)
elif s == 0 or t == 0:
    u += v
    print(u)
else: 
    u += min(s - 1, t - 1) + v + 1
    print(u)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = 0
t = 0
u = 0
A = []
for i in range(N):
  m = input()
  A.append(m)
  u += m.count("AB")
  if m[0] == B:
    s += 1
  if m[-1] == A:
    t += 1
u += min(s, t)
print(u)
Problem p03071 (python)

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

if A > B:
  print(2 * A - 1)
elif A < B:
  print(2 * B - 1)
else:
  print(A + B)

Buggy submission (verdict: Runtime Error):
A, B = map(int,iput().split())

if A > B:
  print(2 * A - 1)
elif A < B:
  print(2 * B - 1)
else:
  print(A + B)
Problem p03095 (python)

Fixed submission:
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
print("NO")

Buggy submission (verdict: Runtime Error):
N, A, B = map(int,input().split())
print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
S =list(input())
s = list(set(S))
m = 1
for i in range(len(s)):
    m *= (S.count(s[i]) + 1)
    
print((m - 1) % (10 ** 9 + 7)
Problem p03110 (python)

Fixed submission:
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = float(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)

Buggy submission (verdict: Runtime Error):
Ot = 0
N = int(input())
for i in range (N):
    X = input().split()
    x = int(X[0])
    if X[1] == "BTC":
        Ot += x * 380000
    else:
        Ot += x
print(Ot)

Buggy submission (verdict: Runtime Error):
Ot = 0
N = int(input())
for i in range (N):
  X = input().split()
  x = int(X[0])
  if X[1] == "BTC":
    Ot += x * 380000
  else:
    Ot += x
print(Ot)
Problem p03145 (python)

Fixed submission:
L = [int(x) for x in input().split()]
L.sort()
print(L[1] * L[0] // 2)

Buggy submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[2] / 2)

Buggy submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[1] / 2)

Buggy submission (verdict: Runtime Error):
L = [int(x) for x in input().split]
L.sort()
print(L[1] * L[1])
Problem p03206 (python)

Fixed submission:
D = int(input())
C = "Christmas"
if 22 <= D <= 25:
	for i in range(D, 25):
		C += " Eve"
	print(C)

Buggy submission (verdict: Runtime Error):
D = int(input())
C = "Chiristmas"
if 22 <= D <= 25:
  for i in range(D, 25):
    C += " Eve"
	print(C)
Problem p03211 (python)

Fixed submission:
S = input()
SS = int(S)
for i in range(0, len(S) - 2):
            X = int(S[i: i + 3])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)

Buggy submission (verdict: Runtime Error):
S = input()
SS = int(S)
for i in range(0, 9):
    for j in range(0, i):
        for k in range(0, j):
            X = int(S[k] + S[j] + S[i])
            if abs(753 - X) < SS:
                SS = abs(753 - X)
print(SS)
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A + B)

Buggy submission (verdict: Runtime Error):
N = input()
if N == 1:
  print("Hello World")
else:
  A = input()
  B = input()
  print(A + B)
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
if (A * B) % 2 == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input()split())
if (A * B) % 2 == 1:
  print("Yes")
else:
  print("No")
Problem p03282 (python)

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

for i in range(K):
  if S[i] != "1":
    print(S[i])
    sys.exit()
print(1)

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

k = -1
while S[k+1] == "1":
  k += 1

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

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

k = -1
while S[k+1] == "1":
  k += 1
  print(k)

if K <= k:
  print(1)
else:
  print(S[k+1])
Problem p03284 (python)

Fixed submission:
N, K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N, K = map(int input().split())
if N % K == 0:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
N, K = map(int input().split())
if N == K:
  print(0)
else:
  print(1)
Problem p03292 (python)

Fixed submission:
A = [int(x) for x in input().split()]
A.sort()
print(A[2] - A[0])

Buggy submission (verdict: Runtime Error):
A = [int(x) for x in input()split()]
A.sort()
print(A[2] - A[0])
Problem p03311 (python)

Fixed submission:
def mm(N, A, x):
  S = 0
  for i in range(N):
    S += abs(A[i] - x)
  return S

N = int(input())
A = []
j = 0
for i in input().split():
  j += 1
  A.append(int(i)-j)
A.sort()
if N % 2 == 0:
  print(mm(N, A, A[N//2]))
elif N == 1:
  print(0)
else:
  print(min(mm(N, A, A[N//2]), mm(N, A, A[N//2 + 1])))

Buggy submission (verdict: Runtime Error):
def mm(N, A, x):
  S = 0
  for i in range(N):
    S += abs(A[i] - x)
  return S

N = int(input())
A = []
j = 0
for i in input().split():
  j += 1
  A.append(int(i)-j)
A.sort()
if N % 2 == 0:
  print(mm(N, A, A[N//2]))
else:
  print(min(mm(N, A, A[N//2]), mm(N, A, A[N//2 + 1])))
Problem p03369 (python)

Fixed submission:
S = input()
print(700 + S.count("o") * 100)

Buggy submission (verdict: Runtime Error):
S = input()
print(700 + S.count(o) * 100)
Problem p03416 (python)

Fixed submission:
A, B = map(int, input().split())
c = 0
for i in range(A, B + 1):
    if str(i) == str(i)[::-1]:
        c += 1
print(c)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
c = 0
for i in range(A, B + 1):
  if str(i) = str(i)[::-1]
  c += 1
print(c)
Problem p03424 (python)

Fixed submission:
N = int(input())
S = input().split()
if "Y" in S:
    print("Four")
else:
    print("Three")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [int(i) for i in range(S)]
if "Y" in S:
  print("Four")
else:
  print("Three")
Problem p03436 (python)

Fixed submission:
from collections import deque

H, W = map(int, input().split())
S = [input() for i in range(H)]
g = 0
q = deque()
q.append((0, 0))
dist = [[0 for j in range(W)] for i in range(H)]
dr = [(1,0),(-1,0),(0,1),(0,-1)]

while len(q):
    r = q.popleft()
    x = r[1]
    y = r[0]
    now = dist[y][x]
    if y == H-1 and x == W-1:
        g = 1
        break
    for d in range(4):
        nx = x + dr[d][0]
        ny = y + dr[d][1]
        if 0 <= nx < W and 0 <= ny < H:
            if S[ny][nx] != "#" and dist[ny][nx] == 0:
                dist[ny][nx] = now+1
                q.append((ny,nx))

sharp = sum([i.count("#") for i in S])
if  g == 1:
  print(H * W - now - sharp - 1)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
from collections import deque

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

q = deque()
q.append((0, 0))
dist = [[0 for j in range(W)] for i in range(H)]
dr = [(1,0),(-1,0),(0,1),(0,-1)]

while (True):
    r = q.popleft()
    x = r[1]
    y = r[0]
    now = dist[y][x]
    if y == H-1 and x == W-1:
        break
    for d in range(4):
        nx = x + dr[d][0]
        ny = y + dr[d][1]
        if 0 <= nx < W and 0 <= ny < H:
            if S[ny][nx] != "#" and dist[ny][nx] == 0:
                dist[ny][nx] = now+1
                q.append((ny,nx))
sharp = sum([i.count("#") for i in S])
print(H * W - now - sharp - 1)
Problem p03455 (python)

Fixed submission:
a, b = map(int,input().split())
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input())
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
Problem p03456 (python)

Fixed submission:
N = int("".join(input().split()))
if int((N**(1/2))) **2 == N:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
print("Yes") if int(int(input().gsub(" ", "")) ** (1/2)) ** 2 = int(input().gsub(" ", "") else print("No")
Problem p03473 (python)

Fixed submission:
M = int(input())
print(48 - M)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input() 
if S[A] == "-" and (S[0:A]+S[A+1:B]).isdigit():
    print("Yes")
else:
    print("No")
Problem p03545 (python)

Fixed submission:
import sys

S = input()
c = 0


op = len(S) - 1  # すき間の個数

for i in range(2 ** op):
  T = ""
  for j in range(op):
    T += S[j]
    if ((i >> j) & 1):
      T += "+"
    else:
      T += "-"
  T += S[op]
  if eval(T) == 7:
    print(T+"=7")
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys

S = input()
c = 0


op = len(S) - 1  # すき間の個数

for i in range(2 ** op):
  T = ""
  for j in range(op_cnt):
    T += S[j]
    if ((i >> j) & 1):
      T += "+"
    else:
      T += "-"
  T += S[op_cnt]
  if eval(T) == 7:
    print(T+"=7")
    sys.exit()
Problem p03563 (python)

Fixed submission:
R=int(input())
G=int(input())
print(2*G-R)

Buggy submission (verdict: Runtime Error):
R=int(input())
G=int(input())
print(2G-R)
Problem p03565 (python)

Fixed submission:
def output(S,T,i,j):
  op = ""
  for k in S[:j-i]:
    if k == "?":
      op += "a"
    else:
      op += k
  op += T
  if j-i+len(T) < len(S):
    for k in S[j-i+len(T):]:
      if k == "?":
        op += "a"
      else:
        op += k
  return op


S = input()
T = input()
SS = len(S)
TT = len(T)
cand = []
if TT > SS:
  print("UNRESTORABLE")
else:
  for i,t in enumerate(T):
    for j,s in enumerate(S):
      c = 0
      if ((t == s) or (s == "?")) and (i <= j) and (TT - i <= SS - j):
        for ss, tt in zip(S[j-i:], T):
          if ss != tt and ss != "?":
            break
          else:
            c += 1
        if c == TT:
          cand.append(output(S,T,i,j))
  cand.sort()
  cand.append("UNRESTORABLE")
  print(cand[0])

Buggy submission (verdict: Runtime Error):
def output(S,T,i,j):
  op = ""
  for k in S[:j-i]:
    if k == "?":
      op += "a"
    else:
      op += k
  op += T
  if j-i+len(T) < len(S):
    for k in S[j-i+len(T):]:
      if k == "?":
        op += "a"
      else:
        op += i
  return op


S = input()
T = input()
SS = len(S)
TT = len(T)
cand = []
if TT > SS:
  print("UNRESTORABLE")
else:
  for i,t in enumerate(T):
    for j,s in enumerate(S):
      c = 0
      if ((t == s) or (s == "?")) and (i <= j) and (TT - i <= SS - j):
        for ss, tt in zip(S[j-i:], T):
          if ss != tt and ss != "?":
            break
          else:
            c += 1
        if c == TT:
          cand.append(output(S,T,i,j))
  cand.sort()
  cand.append("UNRESTORABLE")
  print(cand[0])

Buggy submission (verdict: Runtime Error):
def output(S,T,i,j):
  op = ""
  for k in S[:j-i]:
    if k == "?":
      op += "a"
    else:
      op += k
  op += T
  if j-i+len(T) < len(S):
    for k in S[j-i+len(T):]:
      if k == "?":
        op += "a"
      else:
        op += i
  return op


S = input()
T = input()
SS = len(S)
TT = len(T)
cand = []
if TT > SS:
  print("UNRESTORABLE")
else:
  for i,t in enumerate(T):
    for j,s in enumerate(S):
      c = 0
      if ((t == s) or (s == "?")) and (i <= j) and (TT - i <= SS - j):
        for ss, tt in zip(S[j-i:j-i+TT+1], T):
          if ss != tt and ss != "?":
            break
          else:
            c += 1
        if c == TT:
          cand.append(output(S,T,i,j))
  cand.sort()
  cand.append("UNRESTORABLE")
  print(cand[0])

Buggy submission (verdict: Runtime Error):
def output(S,T,i,j):
  op = ""
  for k in S[:j-i]:
    if k == "?":
      op += "a"
    else:
      op += k
  op += T
  if j-i+len(T) < len(S):
    for k in S[j-i+len(T):]:
      if k == "?":
        op += "a"
      else:
        op += i
  return op


S = input()
T = input()
SS = len(S)
TT = len(T)
cand = []
for i,t in enumerate(T):
    for j,s in enumerate(S):
      c = 0
      if ((t == s) or (s == "?")) and (i <= j) and (TT - i <= SS - j):
        for ss, tt in zip(S[j-i:j-i+TT+1], T):
          if ss != tt and ss != "?":
            break
          else:
            c += 1
        if c == TT:
          cand.append(output(S,T,i,j))
cand.sort()
cand.append("UNRESTORABLE")
print(cand[0])
Problem p03573 (python)

Fixed submission:
A, B, C = map(int, input().split())
print(A^B^C)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, intput().split())
print(A^B^C)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, intput().split())
print(A ^ B ^ C)
Problem p03605 (python)

Fixed submission:
N=input()
if N[0]=="9" or N[1]=="9":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
if N[0]=="9" or N[1]=="9":
  print("Yes")
else:
  print("No")
Problem p03609 (python)

Fixed submission:
x,t=map(int,input().split())
print(x-t) if x-t>0 else print(0)

Buggy submission (verdict: Runtime Error):
x,t=map(int,input())
print(x-t) if x-t>0 else print(0)
Problem p03624 (python)

Fixed submission:
S = input()
A = [chr(ord('a') + i) for i in range(26)]
c = 0

for i in range(26):
  if A[i] in S:
    continue
  else:
    print(A[i])
    c = 1
    break
if c == 0:
  print("None")

Buggy submission (verdict: Runtime Error):
S = input()
A = [chr(ord('a') + i) for i in range(26)]
c = 0

for i in range(26):
  if A[i] in S:
    continue
  else:
    print(A[i])
    c = 1
    break
if c = 0:
  print("None")
Problem p03693 (python)

Fixed submission:
print("YES") if int(input().replace(" ", "")) % 4 == 0 else print("NO")

Buggy submission (verdict: Runtime Error):
print("YES") if int(input().gsub(" ", "")) % 4 == 0 else print("NO")