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

Fixed submission:
N, K = map(int, input().split())
V = list(map(int, input().split()))
U = V[::-1]
ret = 0

m = min(N, K)
for l in range(m+1):
    for r in range(m+1-l):
        hold = V[:l] + U[:r]
        hold.sort()
        for d in range(K+1-l-r):
            ret = max(ret, sum(hold[d:]))

print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-r, N):
        hold.append(V[i])
    hold.sort()
    return 0 if d >= len(hold) else sum(hold[d:]) 

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = K - l - r
        ret = max(ret, calc(l, r, d))
print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, max(N-1-r,-1), -1):
        hold.append(V[i])
    hold.sort()
    return 0 if d >= len(hold) else sum(hold[d:]) 

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = max(K - l - r, 0)
        ret = max(ret, calc(l, r, d))
print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, N-1-r, -1):
        hold.append(V[i])
    hold.sort()
    return 0 if d >= len(hold) else sum(hold[d:]) 

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = max(K - l - r, 0)
        ret = max(ret, calc(l, r, d))
print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, N-1-r, -1):
        hold.append(V[i])
    hold.sort()
    return sum(hold[d:])

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = max(K - l - r, 0)
        ret = max(ret, calc(l, r, d))
print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, N-1-r, -1):
        hold.append(V[i])
    hold.sort()
    return sum(hold[d:])

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = K - l - r
        if d > l + r:
            continue
        ret = max(ret, calc(l, r, d))
print(ret)

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

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, N-1-r, -1):
        hold.append(V[i])
    hold.sort()
    return sum(hold[d:])

ret = 0
for l in range(K):
    for r in range(K-l):
        d = K - l - r
        if d > l + r:
            continue
        ret = max(ret, calc(l, r, d))
print(ret)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
N = int(input())
a = [[] for _ in range(N)]
b = [[] for _ in range(N)]
for i in range(N-1):
    x, y, z = map(int, input().split())
    x, y, z = x-1, y-1, z % 2
    a[x].append([y, z])
    b[y].append([x, z])
dist = [0] * N
visited = [0] * N
print("")

def dfs(v, prev, dist, predist, visited):
    if visited[v]:
        return dist
    dist[v] = dist[prev] ^ predist
    visited[v] = 1
    for i in a[v]:
        dist = dfs(i[0], v, dist, i[1], visited)
    for i in b[v]:
        dist = dfs(i[0], v, dist, i[1], visited)
    return dist

dist = dfs(0, 0, dist, 0, visited)
for i in dist:
    print(i)

Buggy submission (verdict: Runtime Error):
N = int(input())
edge = [[] for _ in range(N)]

for _ in range(N-1):
    u,v,w = map(int, input().split())
    w %= 2
    u, v = u-1, v-1
    edge[u].append((v,w))
    edge[v].append((u,w))

ret = [0] * N
def dfs(pv, v, dist):
    ret[v] = dist
    for nv, w in edge[v]:
        if nv == pv:
            continue
        dfs(v, nv, (dist+w)%2)

dfs(-1,0,0)
print(*ret, sep="\n")

Buggy submission (verdict: Runtime Error):
N = int(input())
edge = [[] for _ in range(N)]

for _ in range(N-1):
    u,v,w = map(int, input().split())
    w %= 2
    u, v = u-1, v-1
    edge[u].append((v,w))
    edge[v].append((u,w))

ret = [0] * N
def dfs(pv, v, dist):
    ret[v] = dist
    for nv, w in edge[v]:
        if nv == pv:
            continue
        dfs(v, nv, (dist+w)%2)

dfs(-1,0,0)
print(ret)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [[] for _ in range(N)]
b = [[] for _ in range(N)]
for i in range(N-1):
    x, y, z = map(int, input().split())
    x, y, z = x-1, y-1, z % 2
    a[x].append([y, z])
    b[y].append([x, z])
dist = [0] * N
visited = [0] * N
print("")

def dfs(v, prev, dist, predist, visited):
    if visited[v]:
        return dist
    dist[v] = dist[prev] ^ predist
    visited[v] = 1
    for i in a[v]:
        dist = dfs(i[0], v, dist, i[1], visited)
    for i in b[v]:
        dist = dfs(i[0], v, dist, i[1], visited)
    return dist

dist = dfs(0, 0, dist, 0, visited)
for i in dist:
    print(i)
Problem p03048 (python)

Fixed submission:
cnt = 0
R, G, B, N = map(int, input().split())
comb = []
tmp = []
rgb = [R, G, B]

for r in range((N//R)+2):
    for g in range((N//G)+2):
        m = N - r*R - g*G
        if m == 0 or (m % B == 0 and m >= B):
            cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
a, b, ab, ret = 0, 0, 0, 0
for i in range(N):
    s = input()
    l = len(s) - 1
    if s[0] == "B":
        b += 1
    if s[l] == "A":
        a += 1
    ret += s.count("AB")
if a == b:
    a -= 1
ab = min(a,b)
print(ret + ab)
Problem p03067 (python)

Fixed submission:
a,b,c = map(int, input().split())
if (a <= c and c <= b) or (b <= c and c <= a):
    print("Yes")
else:
    print("No")

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

dot = S.count(".")
sha = 0
res = 10**9
for i in range(1,N):
    if i == "#":
        sha += 1
    else:
        dot -= 1
    tmp = sha + dot
    res = min(res, tmp)

print(res)
Problem p03069 (python)

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

res = dot = S.count(".")
sha = 0
for i in range(N):
    if S[i] == "#":
        sha += 1
    else:
        dot -= 1
    tmp = sha + dot
    res = min(res, tmp)

print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
 
res = 0
tmp = ""

for i in range(N-1,-1,-1):
    if S[i] == "#":
        continue
    dot = S[:i+1].count(".")
    sha = S[:i+1].count("#")
    break
print(min(dot, sha))
Problem p03079 (python)

Fixed submission:
A, B, C = map(int, input().split())
msg = 'Yes' if A == B and B == C else 'No'
print(msg)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
msg = 'Yes' if A == B and B == C else 'No'
print(mssg)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
msg = 'YES' if A == B and B == C else 'NO'
print(mssg)
Problem p03080 (python)

Fixed submission:
N = int(input())
S = input()
r = S.count('R')
b = S.count('B')
msg = 'Yes' if r > b else 'No'
print(msg)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
r = s.count('R')
b = s.count('B')
msg = 'Yes' if r > b else 'No'
print(msg)
Problem p03087 (python)

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


cnt = [0] * (N)

for i in range(1, N):
	if S[i-1:i+1] == "AC":
		cnt[i] = cnt[i-1] + 1
	else:
		cnt[i] = cnt[i-1]

for _ in range(Q):
	l, r = map(int, input().split())
	print(cnt[r-1] - cnt[l-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
array = [0,0]
for i in range(len(S)-2):
    s = S[i]+S[i+1]
    array.append(array[i]+s.count("AC"))
array.append(array[i+1])
for i in range(Q):
    s, e = map(int, input().split())
    print(array[e] - array[s])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
array = [0,0]
for i in range(len(S)-2):
    s = S[i]+S[i+1]
    array.append(array[i]+s.count("AC"))
array.append(array[i+1])
for i in range(Q):
    s, e = map(int, input().split())
    print(array[e-1] - array[s-1])

Buggy submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
array = [0]
for i in range(len(S)-2):
    s = S[i]+S[i+1]
    array.append(array[i]+s.count("AC"))
array.append(array[i+1])
for i in range(Q):
    s, e = map(int, input().split())
    print(array[e-1] - array[s-1])
Problem p03138 (python)

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

# 最大値を取るf(x)のxを求める
# digitsは下位桁 < 上位桁で1になっているbitをカウントする
digits = [0] * 40
for i in range(40):
    for a in A:
        if (a >> i) & 1:
            digits[i] += 1

# Kを考慮してmax_xを求める方法がわからない
# 桁ごとに最適なbitはすでにわかっていて、他の桁のbitに影響を受けることはないので、
# 上位桁から見ていって、Kが1になっている部分ならフラグを立てる
# 上位桁から見てKが1のbitが出てから、K:1,max_x:0のフラグを立てたら、その桁より下位桁のbitはなんでもよくなる
check_K = True
max_x = 0
for i, d in enumerate(reversed(digits)):
    i = 40 - i - 1
    if check_K and K < pow(2, i):
        continue
    if d <= (N-d) and ((K >> i) & 1 == 1 or not check_K):
        max_x += 2 ** i
    elif (K >> i) & 1 == 1:
        check_K = False
    
#print(max_x)
ans = 0
for a in A:
    ans += a ^ max_x

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int,input().split())
a = np.array([int(i) for i in input().split()])
best = 0
for i in range(k+1):
    aa = np.full(len(a), i)
    tmp = np.sum(a ^ aa)
    if best < tmp:
        best = tmp
print(best)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, k = map(int,input().split())
a = [int(i) for i in input().split()]
best = 0
for i in range(k+1):
    aa = np.full(len(a), i)
    tmp = np.sum(a ^ aa)
    if best < tmp:
        best = tmp
print(best)
Problem p03139 (python)

Fixed submission:
n, a, b = map(int, input().split())
print(min(a, b), max((a+b-n), 0))

Buggy submission (verdict: Runtime Error):
# n, a, b = map(int, input().split())
print(min(a, b), max((a+b-10), 0))
Problem p03141 (python)

Fixed submission:
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x:sum(x), reverse=True)
tk = 0
ak = 0
for i, (a, b) in enumerate(AB):
    if i % 2 == 0:
        tk += a
    else:
        ak += b
print(tk-ak)

Buggy submission (verdict: Runtime Error):
n = int(input())
a1, a2 = map(int,input().split())
b1, b2 = map(int,input().split())
c1, c2 = map(int,input().split())
import math
a = [a1, b1, c1]
b = [a2, b2, c2]

def combinationListRecursive(data, r):
  if r == 0 or r > len(data):
    return []

  result = []
  _combinationListRecursive(data, r, 0, [], result)
  return result


def _combinationListRecursive(data, r, start, progress, result):
  if r == 0:
    result.append(progress)
    return

  for i in range(start, len(data)):
    _combinationListRecursive(data, r - 1, i + 1, progress + [data[i]], result)

result = combinationListRecursive(range(n), math.ceil(n/2))
best = 0
for i in result:
    atmp = 0
    btmp = 0
    for k in range(n):
        if k in i:
            atmp += a[k]
        else:
            btmp += b[k]
    if best < atmp - btmp:
        best = atmp - btmp
print(best)
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
import numpy as np

h = np.array(h)
zero = np.array([int(0) for i in range(len(h))])

def calc(h, zero, minus):
    for k in range(len(h)):
        if minus[k] != 0:
            if k == len(h) - 1:
                zero[k] = zero[k] + 1
                return
            for w in range(k+1, len(h)):
                if minus[w] == 0:
                    zero[k:w] = zero[k:w] + 1
                    return
                elif w == len(h) - 1:
                    zero[k::] = zero[k::] + 1
                    return

def main(h, zero):
    i = 0
    minus = h - zero
    while np.sum(minus) != 0:
        calc(h ,zero, minus)
        i += 1
        minus = h - zero
    print(i)

main(h, zero)
Problem p03146 (python)

Fixed submission:
s = int(input())
def functionF(n):
    result = n/2 if n % 2 == 0 else 3 * n + 1
    return int(result)

def calc(s):
    array = []
    for i in range(1,1000000):
        if i == 1:
            array.append(s)
        elif i > 1:
            array.append(functionF(array[i - 2]))
            for k in range(1, i):
#                 print(i, k)
#                 print(array[i-1], array[k-1])
                if array[i-1] == array[k-1]:
                    print(i)
                    return
calc(s)

Buggy submission (verdict: Runtime Error):
s = int(input())
def functionF(n):
    result = n/2 if n % 2 == 0 else 3 * n + 1
    return int(result)
def calc(s):
  array = []
  for i in range(1,1000000):
    if i == 1:
      array.append(s)
      elif i > 1:
        array.append(functionF(array[i - 2]))
        return array
def result(s):
    result = calc(s)
    for i in range(1, 1000000):
#         print('i',i)
        for k in range(i):
#             print('k',k)
#             print(result[i], result[k])
            if result[i] == result[k]:
                print(i - 1)
                return
Problem p03149 (python)

Fixed submission:
N = [int(i)for i in input().split()]
res = "NO"
if 1 in N and 9 in N and 7 in N and 4 in N:
  res = "YES"

print(res)

Buggy submission (verdict: Runtime Error):
N = [int(i) in input().split()]
res = "NO"
if 1 in N and 9 in N and 7 in N and 4 in N:
  res = "YES"

print(res)
Problem p03164 (python)

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

MAX_V = N * (10 ** 3)
w, v = [], []
for _ in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)

dp = [[10**9+7 for _ in range(MAX_V + 1)] for _ in range(N + 1)]
dp[0][0] = 0

for i in range(N):
    for j in range(MAX_V + 1):
        if j - v[i] >= 0:
            dp[i + 1][j] = min(dp[i][j],dp[i][j - v[i]] + w[i])
        else:
            dp[i + 1][j] = dp[i][j]

mv = 0
for i in range(MAX_V + 1):
    if dp[N][i] <= W:
        mv = i
print(mv)

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

MAX_V = N * (10 ** 3)
wv = [list(map(int, input().split())) for _ in range(N)]
dp = [10**9+7 for _ in range(MAX_V + 1)]
dp[0] = 0

for w, v in range(N):
    for j in range(MAX_V + 1):
        if j - v >= 0:
            dp[j] = min(dp[j],dp[j - v] + w)
        else:
            dp[j] = dp[j]

mv = 0
for i in range(MAX_V + 1):
    if dp[i] <= W:
        mv = i

print(mv)
Problem p03165 (python)

Fixed submission:
s = input()
t = input()
ls = len(s)
lt = len(t)
dp = [[0] * (ls+1) for _ in range(lt+1)]

for i in range(1, lt+1):
    tt = t[i-1]
    for j in range(1, ls+1):
        ts = s[j-1]
        if ts == tt:
            dp[i][j] = dp[i-1][j-1] + 1
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

ret = []
while ls > 0 and lt > 0:
    if dp[lt][ls] == dp[lt][ls-1]:
        ls -= 1
    elif dp[lt][ls] == dp[lt-1][ls]:
        lt -= 1
    else:
        ret.append(s[ls-1])
        ls -= 1
        lt -= 1

ret.reverse()
print("".join(ret))

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ls = len(s)
lt = len(t)
dp = [[0] * (ls+1) for _ in range(lt+1)]

for i in range(1, lt+1):
    tt = t[i-1]
    for j in range(1, ls+1):
        ts = s[j-1]
        if ts == tt:
            dp[i][j] = dp[i-1][j-1] + 1
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

ret = []
while ls > 0 and lt > 0:
    # dpテーブルの番号が一致しているということは、今評価対象の文字は最長共通部分列に含まれないということになる
    # そのため評価対象の文字を変更して次のループに入る
    # dpテーブルを右下から左上になめるように見ていくのは、評価対象以降の文字列の影響を除くため
    if dp[lt][ls] == dp[lt][ls-1]:
        ls -= 1
    elif dp[lt][ls] == dp[lt-1][ls]:
        lt -= 1
    else:
        ret.append(s[ls])
        ls -= 1
        lt -= 1

ret.reverse()
print("".join(ret))
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

N, M = map(int, input().split())
path = [[] for _ in range(N)]
for _ in range(M):
    x, y = map(int, input().split())
    x, y = x-1, y-1
    path[x].append(y)

dp = [-1] * N
def dfs(v):
    if dp[v] > -1:
        return dp[v] + 1
    ret = 0
    for i in path[v]:
        ret = max(ret, dfs(i))
    dp[v] = ret
    return ret + 1


for i in range(N):
    if dp[i] < 0:
        dfs(i)

print(max(dp))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
path = [[] for _ in range(N)]
for _ in range(M):
    x, y = map(int, input().split())
    x, y = x-1, y-1
    path[x].append(y)

dp = [0] * N
def dfs(v, dist):
    for i in path[v]:
        dp[v] = max(dp[v], dfs(i, dist+1))
    return dist

for i in range(N):
    dfs(i, 0)
print(max(dp))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
path = [[] for _ in range(N)]
for _ in range(M):
  x, y = map(int, input().split())
  x, y = x-1, y-1
  path[x].append(y)

# ノードからの最大移動回数をメモ
dp = [-1] * N

def dfs(v, dist):
  for nv in path[v]:
    dp[v] = max(dfs(nv, dist+1),dp[v])
  return dist

for i in range(N):
  if dp[i] < 0:
    dp[i] = dfs(i, 0)
  
print(max(dp))
Problem p03167 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]
MOD = 10 ** 9 + 7
count = [0]
dp = [[-1] * W for _ in range(H)]

def dfs(x, y):
  ret = 0
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      ret += 1
      continue
    elif nx >= W or ny >= H:
      continue
    elif dp[ny][nx] > -1:
      ret += dp[ny][nx]
      continue
    elif field[ny][nx] == "#":
      continue
    else:
      ret += dfs(nx, ny)
  dp[y][x] = ret % MOD
  return ret

dfs(0,0)
print(dp[0][0])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]
MOD = 10 ** 9 + 7
count = [0]
dp = [[-1] * W for _ in range(H)]

def dfs(x, y):
  ret = 0
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      ret += 1
    elif dp[ny][nx] > -1:
      ret += dp[ny][nx]
    elif nx < W and ny < H:
      if field[ny][nx] == "#":
        ret += dfs(nx, ny)
  dp[y][x] = ret % MOD
  return ret

dfs(0,0)
print(dp[0][0])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]
MOD = 10 ** 9 + 7
count = [0]
dp = [[-1] * W for _ in range(H)]

def dfs(x, y):
  ret = 0
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      ret += 1
    elif dp[ny][nx] > -1:
      ret += dp[ny][nx]
    elif nx < W and ny < H and field[ny][nx] == "#":
      ret += dfs(nx, ny)
  dp[y][x] = ret % MOD
  return ret

dfs(0,0)
print(dp[0][0])

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
field = [list(input()) for _ in range(H)]

count = [0]
def dfs(x, y):
  for nx, ny in ((1,0), (0,1)):
    nx += x
    ny += y
    if nx == W-1 and ny == H-1:
      count[0] += 1
      continue
    if nx >= W or ny >= H:
      continue
    if field[ny][nx] == "#":
      continue
    dfs(nx, ny)

dfs(0,0)
print(count[0])
Problem p03175 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)

MOD = 10 ** 9 + 7
def dfs(v, pv):
    white, black = 1, 1
    for nv in edge[v]:
        if nv == pv: continue
        rw, rb = dfs(nv, v)
        white *= rw + rb
        white %= MOD
        black *= rw
        black %= MOD
    return white, black

N = int(input())
edge = [[] for _ in range(N)]

for i in range(N-1):
    x, y = map(lambda x:int(x)-1, input().split())
    edge[x].append(y)
    edge[y].append(x)

print(sum(dfs(0, -1)) % MOD)

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 + 7
def dfs(v, pv):
    dp[v][0] = dp[v][1] = 1
    for nv in edge[v]:
        if nv == pv: continue
        dfs(nv, v)
        dp[v][0] *= dp[nv][0] + dp[nv][1]
        dp[v][0] %= MOD
        dp[v][1] *= dp[nv][0]
        dp[v][1] %= MOD

N = int(input())
edge = [[] for _ in range(N)]

for i in range(N-1):
    x, y = map(lambda x:int(x)-1, input().split())
    edge[x].append(y)
    edge[y].append(x)

dp = [[0] * 2 for _ in range(10**5+10)]
dfs(0,-1)

print(dp[0][1] + dp[0][0])
Problem p03192 (python)

Fixed submission:
print(input().count("2"))

Buggy submission (verdict: Runtime Error):
print(input().conut("2"))
Problem p03206 (python)

Fixed submission:
cri = {"25":"Christmas",
	"24":"Christmas Eve",
	"23":"Christmas Eve Eve",
	"22":"Christmas Eve Eve Eve"}
print(cri[input()])

Buggy submission (verdict: Runtime Error):
cri = {"25":"Christmas",
	"24":"Christmas Eve",
	"23":"Christmas Eve Eve",
	"22":"Christmas Eve Eve Eve"}
print(cri[nput()])
Problem p03240 (python)

Fixed submission:
N = int(input())
XYH = []
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[2] != 0:
        xyh = tmp
    XYH.append(tmp)

def calc(XYH, xyh):
    for tarx in range(101):
        for tary in range(101):
            tarh = xyh[2] + abs(xyh[0] - tarx) + abs(xyh[1] - tary)
            if all(h==max(tarh - abs(tarx - x) - abs(tary - y), 0) for x, y, h in XYH):
                return list(map(str, [tarx, tary, tarh]))
    
print(" ".join(calc(XYH, xyh)))

Buggy submission (verdict: Runtime Error):
N = int(input())
XYH = []
for i in range(N):
    tmp = list(map(int, input().split()))
    if tmp[2] == 0:
        continue
    XYH.append(tmp)

def calc(XYH):
    tmp = 0
    res = [0,0,0]
    for tarx in range(101):
        for tary in range(101):
            xyh = XYH[0]
            tarh = xyh[2] + abs(xyh[0] - tarx) + abs(xyh[1] - tary)
            if all(h==max(h - abs(tarx - x) - abs(tary - y), 0) for x, y, h in XYH):
                print(" ".join(x,y,h))
                return
    
calc(XYH)
Problem p03244 (python)

Fixed submission:
from collections import Counter
N = int(input())
v = list(map(int, input().split()))
e = []
o = []
for idx, i in enumerate(v):
    if idx % 2 == 0:
        o.append(i)
    else:
        e.append(i)

e = Counter(e).most_common()
o = Counter(o).most_common()
e1 = e[0][1]
e2 = e[1][1] if len(e) > 1 else 0
o1 = o[0][1]
o2 = o[1][1] if len(o) > 1 else 0
cnt = 0
if e[0][0] != o[0][0]:
    cnt = N - e1 - o1
else:
    o = N - e1 - o2
    e = N - e2 - o1
    cnt = min(o, e)
print(cnt)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
v = list(map(int, input().split()))
e = []
o = []
for idx, i in enumerate(v):
    if idx % 2 == 0:
        o.append(i)
    else:
        e.append(i)

e = Counter(e).most_common()
o = Counter(o).most_common()
ea = N // 2
e1 = e[0][1]
e2 = e[1][1]
oa = N - ea
o1 = o[0][1]
o2 = o[1][1]
cnt = 0
if e1 != o1:
    cnt = N - e1 - o1
else:
    if o2 > e1:
        cnt = N - e2 - o1
    else:
        cnt = N - e1 - o2
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input().split()))
o = {}
e = {}
for i, v in enumerate(V):
    if i % 2 == 1:
        if not v in e.keys():
            e[v] = 0
        e[v] += 1
    else:
        if not v in o.keys():
            o[v] = 0
        o[v] += 1

o = sorted(o.values(), reverse=True)
e = sorted(e.values(), reverse=True)

e1 = sum(e[1:])
e2 = sum(e[0] + e[2:])
o1 = sum(o[1:])
o2 = sum(o[2:])
ret = min(e1+o2, e2+o1)
print(ret)
Problem p03261 (python)

Fixed submission:
W = []
judge = True
a = ""
N = int(input())
for i in range(N):
    s = input()
    if i == 0:
        a = s[len(s)-1]
    else:
        if a != s[0] or s in W:
            judge = False
            break
        else:
            a = s[len(s)-1]
    W.append(s)
if judge:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
W = []
judge = True
a = ""
N = int(input())
for i in range(N):
    s = input()
    W.append(s)
    if i == 0:
        a = s[len(s)-1]
    else:
        if a != s[0] or s in W:
            judge = False
            break
        else:
            a = s[len(s)-1]
if judge:
    print("Yes"):
else:
    print("No")