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

Fixed submission:
h, w = map(int, input().split())
a = [input() for _ in range(h)]
mod = 10**9+7

dp = [[0 for _ in range(w+1)] for _ in range(h+1)]
dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if i+1 < h and a[i+1][j] == '.':
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= mod
        if j+1 < w and a[i][j+1] == '.':
            dp[i][j+1] += dp[i][j]
            dp[i][j+1] %= mod

print(dp[h-1][w-1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)

h, w = map(int, input().split())
a = [input() for _ in range(h)]
mod = 10**9+7

dp = [[0 for _ in range(h+1)] for _ in range(w+1)]
dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if (i+1 < h) and (a[i+1][j] == '.'):
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= mod
        if (j+1 < w) and (a[i][j+1] == '.'):
            dp[i][j+1] += dp[i][j]
            dp[i][j+1] %= mod

print(dp[h-1][w-1])

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

h, w = map(int, input().split())
a = [input() for _ in range(h)]
mod = 10**9+7

dp = [[0 for _ in range(h+1)] for _ in range(w+1)]
dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if (i+1 < h) and (a[i+1][j] == '.'):
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= mod
        if (j+1 < w) and (a[i][j+1] == '.'):
            dp[i][j+1] += dp[i][j]
            dp[i][j+1] %= mod

print(dp[h-1][w-1])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for _ in range(h)]
mod = 10**9+7

dp = [[0 for _ in range(h+1)] for _ in range(w+1)]
dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if (i+1 < h) and (a[i+1][j] == '.'):
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= mod
        if (j+1 < w) and (a[i][j+1] == '.'):
            dp[i][j+1] += dp[i][j]
            dp[i][j+1] %= mod

print(dp[h-1][w-1])

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for _ in range(h)]
mod = 10**9+7

dp = [[0 for _ in range(h+1)] for _ in range(w+1)]
dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if i+1 < h and a[i+1][j] == '.':
            dp[i+1][j] += dp[i][j]
            dp[i+1][j] %= mod
        if j+1 < w and a[i][j+1] == '.':
            dp[i][j+1] += dp[i][j]
            dp[i][j+1] %= mod

print(dp[h-1][w-1])
Problem p02845 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
x = 1
l = [0] * n
for k in range(n):
    xl = l[a[k]]
    if a[k] == 0:
        xs = 3
    else:
        xs = l[a[k] - 1]
    if xs + 1 != xl:
        x = x * (xs - xl) % 1000000007
    l[a[k]] = l[a[k]] + 1
print(x)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
def hats(m):
    if m == 1:
        return 3
    else:
        xL = [i for i, j in enumerate(a) if j == a[m - 1]]
        xS = [i for i, j in enumerate(a) if j == a[m - 1] - 1]
        xl = 0
        xs = 0
        for i in range(len(xL)):
            if xL[i] < m - 1:
                xl += 1
        for i in range(len(xS)):
            if xS[i] < m - 1:
                xs += 1
        if xl + 1 == xs:
            return hats(m - 1) % 1000000007
        else:
            return hats(m - 1) * (xs - xl) % 1000000007
print(hats(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
x = 1

def hats(m):
    if m == 1:
        return 3
    else:
        xL = [i for i, j in enumerate(a) if j == a[m - 1]]
        xS = [i for i, j in enumerate(a) if j == a[m - 1] - 1]
        xl = 0
        xs = 0
        for i in range(len(xL)):
            if xL[i] < m - 1:
                xl += 1
        for i in range(len(xS)):
            if xS[i] < m - 1:
                xs += 1
        if xl + 1 == xs:
            return hats(m - 1)
        else:
            return hats(m - 1) * (xs - xl)
print(hats(n) % 1000000007)
Problem p02900 (python)

Fixed submission:
a, b = map(int, input().split())
import math
import fractions
n = fractions.gcd(a, b)
devide = 2
l1 = []
while devide <= math.sqrt(n):
    while n % devide == 0:
        n = n / devide
        l1.append(devide)
    devide += 1
l1.append(n)
l1 = list(set(l1))
if n == 1:
    print(int(len(l1)))
else:
    print(int(len(l1) + 1))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
import math
n = math.gcd(a, b)
devide = 2
l1 = []
while devide <= n:
    while n % devide == 0:
        n = n / devide
        l1.append(devide)
    devide += 1
l1 = list(set(l1))
print(int(len(l1) + 1))
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
t = 0
m = 0
for i in range(n):
    if h[i] > t:
        t = h[i]
    elif t - h[i] >= 2:
        print("No")
        m += 1
        break
if m == 0:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(inut())
h = list(map(int, input().split()))
t = 0
for i in range(n - 2):
    if h[i] - h[i+1] >= 2:
        print("No")
        t = 1
        break
    elif i <= n - 4:
        if h[i] - h[i+1] == 1 and h[i+1] - h[i+2] == 1:
            print("No")
            t = 1
            break
if t == 0:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(inut())
h = list(map(int, input().split()))
t = 0
for i in range(n - 2):
    if h[i] - h[i+1] >= 2:
        print("No")
        t = 1
        break
    elif i <= n - 3:
        if h[i] - h[i+1] == 1 and h[i+1] - h[i+2] == 1:
            print("No")
            t = 1
            break
if t == 0:
    print("Yes")
Problem p03160 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
def frog(num):
    if num == 1:
        return 0
    elif num == 2:
        return abs(h[1] - h[0])
    else:
        l1 = [frog(1), frog(2)]
        for i in range(2, num):
            p1 = l1[i - 1] + abs(h[i - 1] - h[i])
            p2 = l1[i - 2] + abs(h[i - 2] - h[i])
            if p1 >= p2:
                l1.append(p2)
            else:
                l1.append(p1)
    return l1[num - 1]
print(frog(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
def frog(num):
    if num == 1:
        return 0
    elif num == 2:
        return abs(h[1] - h[0])
    else:
        p1 = frog(num - 1) + abs(h[num - 2] - h[num - 1])
        p2 = frog(num - 2) + abs(h[num - 3] - h[num - 1])
        if p1 >= p2:
            return frog(num - 2) + abs(h[num - 3] - h[num - 1])
        else:
            return frog(num - 1) + abs(h[num - 2] - h[num - 1])
print(frog(n))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
def flog(num):
    if num == 1:
        return 0
    elif num == 2:
        return abs(h[1] - h[0])
    else:
        p1 = flog(num - 1) + abs(h[num - 2] - h[num - 1])
        p2 = flog(num - 2) + abs(h[num - 3] - h[num - 1])
        if p1 >= p2:
            return flog(num - 2) + abs(h[num - 3] - h[num - 1])
        else:
            return flog(num - 1) + abs(h[num - 2] - h[num - 1])
print(flog(n))
Problem p03308 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
M = a[0]
m = a[0]
for i in range(1, n):
  if a[i] > M:
    M = a[i]
  if a[i] < m:
    m = a[i]
print(int(M - m))

Buggy submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
M = a[0]
m = a[0]
for i in range(1, n):
  if a[i] > M:
    M = a[i]
  if a[i] < m:
    m = a[i]
print(int(M - m))
Problem p03688 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
import collections
l1 = collections.Counter(a).most_common()
l1.sort()
if len(l1) > 2:
    print("No")
elif len(l1) == 1:#発言が１種類の場合
    if l1[0][0] * 2 <= n or l1[0][0] == n - 1:
        print("Yes")
    else:
        print("No")
else:
    if l1[1][0] - l1[0][0] > 1:
        print("No")
    elif l1[1][1] >= (l1[1][0] - l1[0][1]) * 2 and l1[1][0] > l1[0][1]:
        print("Yes")#多い発言の人数が残りの色数かけ２より多い、全体色数が少ない発言の人数より多い
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
import collections
l1 = collections.Counter(a).most_common()
l1.sort()
if len(l1) > 2　or l1[1][0] - l1[0][0] > 1:
    print("No")
elif len(l1) == 1:#発言が１種類の場合
    if l1[0][0] * 2 <= n or l1[0][0] == n - 1:
        print("Yes")
    else:
        print("No")
else:
    if l1[1][1] >= (l1[1][0] - l1[0][1]) * 2 and l1[1][0] > l1[0][1]:
        print("Yes")#多い発言の人数が残りの色数かけ２より多い、全体色数が少ない発言の人数より多い
    else:
        print("No")
Problem p03862 (python)

Fixed submission:
n, x = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(n - 1):
    if a[i] + a[i + 1] > x:
        count += a[i] + a[i + 1] - x
        if a[i + 1] >= a[i] + a[i + 1] - x:
            a[i + 1] = x - a[i]
        else:
            a[i + 1] = 0
            a[i] = x
print(int(count))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(n - 2):
    if a[i] + a[i + 1] > x:
        count += a[i] + a[i + 1] - x
        a[i + 1] = x - a[i]
if a[n - 1] + a[n] > x:
    count += a[n - 1] + a[n] - x
print(int(count))
Problem p02646 (python)

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

if A>B and A-V*T<=B-W*T:
  print("YES")
elif  A<B and A+V*T>=B+W*T:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,V=map(int, input().split())
B,W=map(int, input().split())
T=int(input())

if A>B and A-V*T=<B-W*T:
  print("YES")
elif  A<B and A+V*T>=B+W*T:
  print("YES")
else:
  print("NO")
Problem p02583 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
 
ans = 0
 
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if l[i] != l[j] and l[j] != l[k] and l[i] != l[k]:
        if l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[i]+l[k]>l[j]:
          ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
 
ans = 0
 
for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] == l[j] and l[j] == l[k] and l[i] == l[k]:
        coutinue
      if (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[i]+l[k]>l[j]):
        ans += 1
        
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))

ans = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] == l[j] or l[j] == l[k] or l[i] == l[k]:
        coutinue
      if (l[i]+l[j]>l[k]) or (l[j]+l[k]>l[i]) or (l[i]+l[k]>l[j]):
        ans += 1
        
print(ans)
Problem p02639 (python)

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

for i in range(len(a)):
  if a[i] == 0:
    print(i+1)

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

for i in range(len(a)):
  if a[i] == 0:
    print(i+1)
    break
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
ans = False
 
for i in range(101):
	for j in range(101):
		if i+j == x and 2*i+4*j == y:
			ans = True
if ans:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
x, y = map(int, input().split())
ans = False

for i in range(101):
  for j in range(101):
    if i+j == x and 2*i + 4*j == y:
		ans = True

if ans:
  print("Yes")
else:
  print("No")
Problem p02658 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
else:
  for i in range(N):
    ans *= a[i]
    if ans > 10 ** 18:
      print(-1)
      break
  else:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
count = 1
if 0 in a:
  print(0)
else:
  for i in range(N):
    count *= a[i]
    if ans > 10 ** 18:
      print(-1)
      break
  else:
    print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
num = 10**18
count = 1
if 0 in nums:
	print(0)
else:
	for i in range(n):
		count *= nums[i]
		if count < num:
			print(-1)
            break
		else:
			print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = map(int,input().split())
num = 10**18
count = 1
for i in range(n):
	count *= nums[i]

if count < num:
	print(-1)
else:
	print(count)
Problem p02760 (python)

Fixed submission:
map_list = [list(map(int,input().split())) for x in range(3)]
 
n = int(input())
for i in range(n):
  a = int(input())
  for i in range(3):
    for j in range(3):
      if map_list[i][j] == a:
        map_list[i][j] = 0

ans = "No"
for k in range(3):
  if map_list[0][k] == map_list[1][k] == map_list[2][k] or \
     map_list[k][0] == map_list[k][1] == map_list[k][2]:
      ans = "Yes"
      break
  if map_list[0][0] == map_list[1][1] == map_list[2][2] or \
	 map_list[0][2] == map_list[1][1] == map_list[2][0]:
      ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
map_list = [int,input().split() for x in range(3)]

n = int(input())
for i in range(n):
  a = int(input())
Problem p03261 (python)

Fixed submission:
n = int(input())
used = list(input() for x in range(n))
ans = "Yes"
for i in range(n-1): 
  if used.count(used[i]) == 2:
    ans = "No"
    break
  if used[i][-1] != used[i+1][0]:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
used = list(input() for x in range(n))
ans = "Yes"
for i in range(n): 
  if used.count(used[i]) == 2:
    ans = "No"
    break
  if used[i][-1] != used[i+1][0]:
    ans = "No"
print(ans)
Problem p02576 (python)

Fixed submission:
n,x,t=map(int,input().split())
print(((n+x-1)//x)*t)

Buggy submission (verdict: Runtime Error):
n,x,t=map(int,input().split())
print(((n+x-1)//x)+*t)
Problem p02606 (python)

Fixed submission:
l,r,d=map(int,input().split())
ans=0
for i in range(l,r+1):
  if i%d==0:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=0
cnt=[0]*500000
print(2*10**2)
for i in range(1,2*10**2+1):
    for j in range(1,2*10**2+1):
        for k in range(1,2*10**2+1):
            cnt[((i+j)**2+(j+k)**2+(k+i)**2)//2-1]+=1
for i in range(n):
    print(cnt[i])
Problem p02705 (python)

Fixed submission:
import math
n=int(input())
print(2*n*math.pi)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
print(2*n*pi)
Problem p02787 (python)

Fixed submission:
h,n=map(int,input().split())
a=[0]*n
b=[0]*n
inf=10**10
for i in range(n):
    a[i],b[i]=map(int,input().split())
dp = [[inf for i in range(h+1)] for j in range(n+1)]
for i in range(n):
    cnt=1
    for j in range(h+1):
            if j-a[i]<0:
                dp[i+1][j]=min(dp[i][j],dp[i][0]+b[i],b[i]*cnt)
            else:
                dp[i+1][j]=min(dp[i][j],dp[i+1][j-a[i]]+b[i],dp[i][j-a[i]]+b[i],b[i]*cnt)
                cnt+=1
"""
for i in range(1,n+1):
    for j in range(h+1):
        if j+a[i]<=h:
            dp[i+1][j+a[i]]=min(dp[i+1][a[i]],dp[i][j]+b[i])"""
print(dp[n][h])
#print(dp)

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=[0]*n
b=[0]*n
inf=10**10
for i in range(n):
    a[i],b[i]=map(int,input().split())
dp = [[inf for i in range(h+2)] for j in range(n+1)]
for i in range(n):
    cnt=1
    for j in range(h+1):
            if j-a[i]<0:
                dp[i+1][j]=min(dp[i][j],dp[i][j-a[i]]+b[i],b[i]*cnt)
            else:
                dp[i+1][j]=min(dp[i][j],dp[i+1][j-a[i]]+b[i],dp[i][j-a[i]]+b[i],b[i]*cnt)
                cnt+=1
"""
for i in range(1,n+1):
    for j in range(h+1):
        if j+a[i]<=h:
            dp[i+1][j+a[i]]=min(dp[i+1][a[i]],dp[i][j]+b[i])"""
print(dp[n][h])
#print(dp)

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=[0]*n
b=[0]*n
inf=10**10
for i in range(n):
    a[i],b[i]=map(int,input().split())
dp = [[inf for i in range(h+1)] for j in range(n+1)]
for i in range(n):
    cnt=1
    for j in range(h+1):
            if j-a[i]<0:
                dp[i+1][j]=min(dp[i][j],dp[i][j-a[i]]+b[i],b[i]*cnt)
            else:
                dp[i+1][j]=min(dp[i][j],dp[i+1][j-a[i]]+b[i],dp[i][j-a[i]]+b[i],b[i]*cnt)
                cnt+=1
"""
for i in range(1,n+1):
    for j in range(h+1):
        if j+a[i]<=h:
            dp[i+1][j+a[i]]=min(dp[i+1][a[i]],dp[i][j]+b[i])"""
print(dp[n][h])
#print(dp)
Problem p02995 (python)

Fixed submission:
import fractions as ff
a,b,c,d=map(int,input().split())
if a%c==0 or a%d==0:
    cnt=1
else:
    cnt=0
if cnt==1:
    print((b-b//c-b//d+b//(c*d//ff.gcd(c,d)))-(a-a//c-a//d+a//(c*d//ff.gcd(c,d))))
else:
    print((b-b//c-b//d+b//(c*d//ff.gcd(c,d)))-(a-a//c-a//d+a//(c*d//ff.gcd(c,d)))+1)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
if b-a+1>c*d//(math.gcd(c,d)):
    print(b-b//c-b//d+b//(c*d//(math.gcd(c,d)))-a+a//c+a//d-a//(c*d//math.gcd(c,d))+1)
else:
    print(b-b//c-b//d+b//(c*d//(math.gcd(c,d)))-a+a//c+a//d-a//(c*d//math.gcd(c,d)))
Problem p02999 (python)

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

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
w,h,x,y=map(int,input().split())
#print(min(max(x*h,(w-x)*h),max(y*w,(h-y)*w)))
if w==x+x and h==y+y:
    print(float(w)*float(h)/2,1)
else:
    print(float(w)*float(h)/2,0)
Problem p03085 (python)

Fixed submission:
x=input()
if x=='A':
    print('T')
elif x=='T':
    print('A')
elif x=='G':
    print('C')
elif x=='C':
    print('G')

Buggy submission (verdict: Runtime Error):
x=input()
if x==A:
  print(T)
elif x==T:
  print(A)
elif x==G:
  print(C)
else:
  print(G)

Buggy submission (verdict: Runtime Error):
x=input()
if x==A:
  print(C)
elif x==T:
  print(G)
elif x==G:
  print(T)
else:
  print(A)
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
ans=[]
for i in range(1,101):
    if a%i==0 and b%i==0:
        ans.append(i)
#print(ans)
print(ans[len(ans)-k])

Buggy submission (verdict: Runtime Error):
import math
a,b,k=map(int,input().split())
count=0
ans=0
x=math.gcd(a,b)
for i in range(x,0,-1):
    if a%i==0 and b%i==0:
        count+=1
        ans=i
        if count==k:
            break
print(ans)
Problem p03129 (python)

Fixed submission:
n,m=map(int,input().split())
if (n+1)//2>=m:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n-k>=1:
    print('YES')
else:
    print('NO')
Problem p03161 (python)

Fixed submission:
# educational DP contest A
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(100000000000)
for m in range(n):
    for j in range(1,min(k+1,n-m)):
        dp[m+j]=changemin(dp[m+j],dp[m]+abs(h[m]-h[m+j]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(1000000)
for m in range(1,n):
    for j in range(1,k+1):
        dp[m]=changemin(dp[m],dp[m-j]+abs(h[m]-h[m-j]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(1000000)
for m in range(1,n):
    for j in range(1,k+1):
        dp[m]=changemin(dp[m],dp[m-j]+abs(h[m]-h[m-j]))
        if m+j==n-1:
            break
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(1000000)
for j in range(1,n):
    for l in range(1,k):
        dp[j]=changemin(dp[j],dp[j-l]+abs(h[j]-h[j-l]))
print(dp[n-1])
Problem p03206 (python)

Fixed submission:
n=int(input())
if n==22:
  print('Christmas Eve Eve Eve')
elif n==23:
  print('Christmas Eve Eve')
elif n==24:
  print('Christmas Eve')
else:
  print('Christmas')

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==22:
  print(Christmas Eve Eve Eve)
elif n==23:
  print(Christmas Eve Eve)
elif n==24:
  print(Christmas Eve)
else:
  print(Christmas)
Problem p03227 (python)

Fixed submission:
s=input()
S=list(s)
if len(S)==2:
    print(s)
else:
    print(S[2]+S[1]+S[0])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
for i in range(k):
    if i%2==0:
        b+=a//2
        a=a//2
    if i%2!=0:
        a+=b//2
        b=b//2
print(a,b)
Problem p03231 (python)

Fixed submission:
import fractions as f
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
N=n//f.gcd(n,m)
M=m//f.gcd(n,m)
for i in range(f.gcd(n,m)):
    if s[i*N]!=t[i*M]:
        ans=-1
        break
if ans!=-1:
    print(n*m//f.gcd(n,m))
else:
    print(-1)
#print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions as f
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
cnt=[""]*((n*m)//f.gcd(n,m))
d=(n*m)//f.gcd(n,m)
N=n//f.gcd(n,m)
M=m//f.gcd(n,m)
for i in range(f.gcd(n,m)):
    if s[i*N]!=t[i*M]:
        ans=-1
        break
if ans!=-1:
    print(d)
else:
    print(-1)
#print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
cnt=[""]*((n*m)//fractions.gcd(n,m))
d=(n*m)//fractions.gcd(n,m)
for i in range(n):
    cnt[i*d//n]=s[i]
for j in range(m):
    if t[j]!=cnt[j*d//m] and cnt[j*d//m]!="":
        ans=-1
    else:
        cnt[j*d//m]=t[j]
if ans!=-1:
    print(d)
else:
    print(-1)
#print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
cnt=[""]*((n*m)//fractions.gcd(n,m))
d=(n*m)//fractions.gcd(n,m)
for i in range(n):
    cnt[i*d//n]=s[i]
for j in range(m):
    if t[j]!=cnt[j*d//m] and cnt[j*d//m]!="":
        ans=-1
        break
    else:
        cnt[j*d//m]=t[j]
if ans!=-1:
    print((n*m)//fractions.gcd(n,m))
else:
    print(-1)
#print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
cnt=[""]*(n*m//fractions.gcd(n,m))
d=n*m//fractions.gcd(n,m)
for i in range(n):
    cnt[i*d//n]=s[i]
for j in range(m):
    if t[j]!=cnt[j*d//m] and cnt[j*d//m]!="":
        ans=-1
        break
    else:
        cnt[j*d//m]=t[j]
if ans!=-1:
    print(n*m//fractions.gcd(n,m))
else:
    print(-1)
print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0
cnt=[""]*(n*m//fractions.gcd(n,m))
d=n*m//fractions.gcd(n,m)
for i in range(n):
    cnt[i*d//n]=s[i]
for j in range(m):
    if t[j]!=cnt[j*d//m] and cnt[j*d//m]!="":
        ans=-1
        break
if ans!=-1:
    print(n*m//fractions.gcd(n,m))
else:
    print(ans)
#print(cnt)

Buggy submission (verdict: Runtime Error):
import fractions
n,m=map(int,input().split())
s=list(input())
t=list(input())
ans=0

cnt=[""]*(n*m//fractions.gcd(n,m))
for i in range(n):
    cnt[i*max(n,m)//n]=s[i]
for j in range(m):
    if t[j]!=cnt[j*max(n,m)//m]:
        ans=-1
        break
if ans!=-1:
    print(n*m//fractions.gcd(n,m))
else:
    print(ans)
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2!=0 and b%2!=0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import fractions
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=abs(x-a[0])
a.sort()
if n==1:
    print(abs(x-a[0]))
else:
    cnt=abs(a[1]-a[0])
    for j in range(n-1):
        cnt=min(abs(a[j+1]-a[j]),cnt)
    for i in range(n):
        ans=min(abs(x-a[i]),ans)
    print(min(ans,cnt))