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

Fixed submission:
import sys

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

x = []
y = []
z = []

for i in range(M):
    s1, c1 = map(int, input().split())
    if s1 == 1:
        x.append(c1)
    elif s1 == 2:
        y.append(c1)
    elif s1 == 3:
        z.append(c1)

if N == 1:
    if len(set(x)) > 1:
        print('-1')
        sys.exit()

    if len(x) == 0:
        x.append(0)

    print(str(x[0]))
    sys.exit()

elif N == 2:
    if len(x) == 0:
        x.append(1)

    if len(set(x)) > 1 or len(set(y)) > 1:
        print('-1')
        sys.exit()

    if len(y) == 0:
        y.append(0)

    if x[0] == 0 and len(x) == 1:
        print('-1')
        sys.exit()
    elif x[0] == 0 and len(x) > 1:
        print(str(x[1]) + str(y[0]))
        sys.exit()

    print(str(x[0]) + str(y[0]))
    sys.exit()

elif N == 3:
    if len(x) == 0:
        x.append(1)

    if len(set(x)) > 1 or len(set(y)) > 1 or len(set(z)) > 1:
        print('-1')
        sys.exit()

    if len(y) == 0:
        y.append(0)
    if len(z) == 0:
        z.append(0)

    if x[0] == 0 and len(x) == 1:
        print('-1')
        sys.exit()
    elif x[0] == 0 and len(x) > 1:
        print(str(x[1]) + str(y[0]) + str(z[0]))
        sys.exit()

    print(str(x[0]) + str(y[0]) + str(z[0]))
    sys.exit()

print('-1')

Buggy submission (verdict: Runtime Error):
import sys

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

x = []
y = []
z = []

for i in range(M):
    s1, c1 = map(int, input().split())
    if s1 == 1:
        x.append(c1)
    elif s1 == 2:
        y.append(c1)
    elif s1 == 3:
        z.append(c1)

if N == 1:
    x.sort()
    print(str(x[0]))
    sys.exit()

elif N == 2:
    if len(x) == 0:
        x.append(0)
    if len(y) == 0:
        y.append(0)
    if x[0] == 0:
        print('-1')
        sys.exit()
    x.sort()
    y.sort()
    print(str(x[0]) + str(y[0]))
    sys.exit()

elif N == 3:
    if len(x) == 0:
        x.append(0)
    if len(y) == 0:
        y.append(0)
    if len(z) == 0:
        z.append(0)
    if x[0] == 0:
        print('-1')
        sys.exit()

    x.sort()
    y.sort()
    z.sort()
    print(str(x[0]) + str(y[0]) + str(z[0]))
    sys.exit()

print('-1')
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline

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

T = [[] for i in range(N)]

for i in range(N-1):
    a, b = map(int, input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = [0 for i in range(N)]

for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(n, r):
    for i in T[n]:
        if i != r:
            ans[i] += ans[n]
            dfs(i, n)

dfs(0, -1)

print(*ans)

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

T = [[] for i in range(N)]

for i in range(N-1):
    a, b = map(int, input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = [0 for i in range(N)]

for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(n, r):
    for i in T[n]:
        if i != r:
            ans[i] += ans[n]
            dfs(i, n)

dfs(0, -1)

print(*ans)

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

T = [[] for i in range(N)]

for i in range(N-1):
    a, b = map(int, input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = [0 for i in range(N)]

for i in range(Q):
    p, x = map(int, input().split())
    O[p-1] += x

def dfs(n, r):
    for i in T[n]:
        if i != r:
            O[i] += O[n]
            dfs(i, n)

dfs(0, -1)

print(*ans)
Problem p03061 (python)

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

def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

X = [0 for i in range(N)]
Y = [0 for i in range(N)]

for i in range(1, N):
    X[i] = gcd(X[i-1], A[i-1])

for i in range(N-1)[::-1]:
    Y[i] = gcd(Y[i+1], A[i+1])

Z = [gcd(X[i], Y[i]) for i in range(N)]
print(max(Z))

Buggy submission (verdict: Runtime Error):
import math

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

print(math.gcd(max(A), min(A)))
Problem p03126 (python)

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

list = [list(map(int, input().split())) for i in range(n[0])]

a = {}
for i in list:
    for j in i[1:]:
        if j in a:
            a[j] = a[j] + 1
        else:
            a[j] = 1

cnt = 0
for x in a.values():
    if x == n[0]:
        cnt += 1

print(cnt)

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

list = [list(map(int, input().split())) for i in range(n[0])]

a = {}
for i in list:
    for j in i[1:]:
        if j in a:
            a[j] = a[j] + 1
        else:
            a[j] = 1

cnt = 0
for x in a.values():
    if x == n[0]:
        print(f'ok:{x}')
        cnt += 1

print(cnt)
Problem p02640 (python)

Fixed submission:
x, y = map(int, input().split())
n = (4*x-y)/2
m = (y-2*x)/2
if y%2 ==1:
  print("No")
else:
  if n <0 or m <0:
    print("No")
  else:
    if n+m==x and 2*n+4*m==y:
      print("Yes")
    else:
      print("No")

Buggy submission (verdict: Runtime Error):
a = y//4
if 2*(x-a)==y-4*a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = y//4
if 2*(x-a)==y-4*a:
  print("YES")
else:
  print("NO")
Problem p02657 (python)

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

print(a*b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a :
  s *= i
  if s > 10**18:
    print("-1")
  else:
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a :
  s *= i
if s > 10**18:
  print("-1")
else:
  print(s)
Problem p02658 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  prrint(0)
else:
  s = 1
  for i in a :
    s *= i
  if s > 10**18:
      print("-1")
  else:
      print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = 1
if 0 in a:
  prrint(0)
else:
  for i in a :
  s *= i
  if s > 10**18:
    print("-1")
  else:
    print(s)

Buggy submission (verdict: Runtime Error):
n = int()
a = list[map(int, input().split())]
s = 1
for i in n+1 :
  ans = s*a[i]
if ans => 10**8:
  print("-1")
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
n = int()
a = list(map(int, input().split()))
s = 1
for i in a[] :
  ans = s*a[i]
if ans => 10**8:
  print("-1")
else:
  print(ans)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a, b=map(int, input().split())
print(max(a+b,a-b,a*b)
Problem p02957 (python)

Fixed submission:
A, B=map(int,input().split())
k = (A+B)//2 
if (A+B)%2 == 0:
  print(k)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(n):
  if a[i]>=b[i]:
    c+=int(b[i])
  else:
    if (a[i]+a[i+1])>=b[i]:
      c+=int(b[i])
      a[i+1]=a[i]+a[i+1]-b[i]
    else:
      c+=int(a[i]+a[i+1])
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(n):
  if a[i]>=b[i]:
    c+=int(b[i])
  else:
    if (a[i]+a[i+1])>=b[i]:
      c+=int(b[i])
      a[i+1]=a[i]+a[i+1]-b[i]
    else:
      c+=int(a[i]+a[i+1])
print(c)

Buggy submission (verdict: Runtime Error):
N = int(input())
m = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
for i in range(N):
  if m[i]<b[i]:
    if (m[i]+m[i+1])>b[i]:
        s += b[i]
        m[i+1] += m[i]-b[i]
    else:
       s += m[i]+m[i+1]
  else:
    s += b[i]
print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
b = sorted(a)
k = 0
for i in range(N):
  if a[i] != b[i]:
    k += 1
if k >2 :
  print("NO")
else:
  print("YES")
Problem p02958 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
b = sorted(a)
k = 0
for i in range(N):
  if a[i] != b[i]:
    k += 1
if k >2 :
  print("NO")
else:
  print("YES")

Buggy submission (verdict: Runtime Error):
N = input()
p = list(map(int,input().split()))
s = sorted(p)
k = 0
for i in range(N):
  if p[i]!=s[i]:
    k += 1
if k < 3 :
   print("YES")
else:
   print("NO")
Problem p02969 (python)

Fixed submission:
a = input()
b = 3*(int(a)**2)
print(b)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for i in range(N)]
s = sorted(a,reverse=True)
for i in range(N):
  if s[0]!=a[i]:
    print(s[0])
  else:
    print(s[1])

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = a//(2*b+1)
if a%(2*b+1) == 0:
  print(s)
else:
  print(s+1)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
if n＊a < b:
  print(int(n＊a))
elif n＊a >= b:
  print(int(b))

Buggy submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
if n＊a < b:
  print(n＊a)
elif n＊a >= b:
  print(b)

Buggy submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
if n＊a <= b:
  print(n＊a)
else:
  print(b)
Problem p02988 (python)

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

Buggy submission (verdict: Runtime Error):
n = input()
a = map(int, input().split())
ans = 0
for i in range(1:n-1):
  if a[i-1]<a[i]<a[i+1] :
    ans+=1 
print(ans)
Problem p02639 (python)

Fixed submission:
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    exit()

Buggy submission (verdict: Runtime Error):
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    eixt()
Problem p02717 (python)

Fixed submission:
x,y,z=input().split()
print(' '.join([z,x,y]))

Buggy submission (verdict: Runtime Error):
x,y,z=input().split()
print(' '.join[z,x,y])
Problem p02756 (python)

Fixed submission:
def main():
  from collections import deque
  s=deque(input())
  q=int(input())
  count=0
  for _ in [0]*q:
    a=list(input().split())
    if len(a)==1:
      count+=1
    else:
      if count%2==0:
        if a[1]=='1':
           s.appendleft(a[2])
        else:
          s.append(a[2])
      else:
        if a[1]=='1':
          s.append(a[2])
        else:
          l=(a[2],s)
          s.appendleft(a[2])
  if count%2==1:
    s=list(s)[::-1]
  print(''.join(s))
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  from collections import deque
  s=deque(input())
  q=int(input())
  count=0
  for _ in [0]*q:
    a=list(input().split())
    if len(a)==1:
      count+=1
    else:
      if count%2==0:
        if a[1]=='1':
           s.appendleft(a[2])
        else:
          s.append(a[2])
      else:
        if a[1]=='1':
          s.append(a[2])
        else:
          l=(a[2],s)
          s.appendleft(a[2])
  if count%2==1:
    s=s[::-1]
  print(''.join(s))
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  s=input()
  q=int(input())
  for _ in [0]*q:
    a=list(input().split())
    if len(a)==1:
      s=reversed(s)
    else:
      if a[1]=='1':
        s=a[2]+s
      else:
        s=s+a[2]
  print(s)
if __name__=='__main__':
  main()
Problem p02761 (python)

Fixed submission:
def main():
  import sys
  input = sys.stdin.readline
  n,m=map(int,input().split())
  if m==0:
    if n==1:
      print(0)
      exit()
    else:
      print(pow(10,n-1))
      exit()
  sc=[list(map(int,input().split())) for _ in range(m)]
  sc=list(map(list, set(map(tuple, sc))))
  sc=sorted(sc,key=lambda x: (x[0],x[1]))
  if len(sc)>n:
    print(-1)
    exit()
  l=['0']*n
  l[0]='1'
  if n==1:
    if sc[0][0]==1:
      print(sc[0][1])
      exit()
    else:
      print(-1)
      exit()
  for i in range(len(sc)):
    if type(l[sc[i][0]-1])==str:
      l[sc[i][0]-1]=sc[i][1]
    else:
      if l[sc[i][0]-1]!=sc[i][1]:
        print(-1)
        exit()
  if len(''.join([str(int(i)) for i in l]))==n and int(''.join([str(int(i)) for i in l]))>=pow(10,n-1):
    print(int(''.join([str(int(i)) for i in l])))
  else:
    print(-1)
  
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n,m=map(int,input().split())
  sc=[list(map(int,input().split())) for _ in range(m)]
  sc=sorted(sc,key=lambda x: (x[0],x[1]))
  l=[0.0]*n
  if n==1:
    if sc[0][1]==sc[-1][1]:
      print(sc[0][1])
      exit()
    else:
      print(-1)
      exit()
  for i in range(len(sc)):
    if type(l[sc[i][0]-1])==float:
      l[sc[i][0]-1]=sc[i][1]
    else:
      if l[sc[i][0]-1]!=sc[i][1]:
        print(-1)
        exit()
  if len(''.join([str(int(i)) for i in l]))==n and int(''.join([str(int(i)) for i in l]))>=pow(10,n-1):
    print(int(''.join([str(int(i)) for i in l])))
  else:
    print(-1)
  
if __name__ == '__main__':
    main()
Problem p02778 (python)

Fixed submission:
s=input()
l=len(s)
print('x'*l)

Buggy submission (verdict: Runtime Error):
s=input()
l=len(s)
print(x*l)
Problem p02838 (python)

Fixed submission:
def main():
  import sys
  input = sys.stdin.readline
  import numpy as np
  n=int(input()) 
  a=np.array(list(map(int,input().split())))
  mod=pow(10,9)+7
  ans=0
  
  for i in range(60):
    x=np.count_nonzero(a & 1)
    ans+=pow(2,i,mod)*x*(n-x)
    ans=ans%mod
    a=a>>1
  print(ans)
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n=int(input())
  a=sorted(list(map(int,input().split())))
  mod=pow(10,9)+7
  x=[0]*61
  for i in a:
    i=bin(i)
    l=len(i)
    for j in range(1,l-1):
      if i[-j]=='1':
        x[j]+=1
  ans=0
  for i in range(1,l+1):
    if x[i]>0:
      ans+=pow(2,i-1,mod)*(x[i]%mod)*((n-x[i])%mod)%mod
      ans%=mod
  print(ans)
if __name__=='__main__':
  main()
Problem p02928 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n,k = map(int,input().split())
a = list(map(int,input().split()))
cnt1 = 0
for i in range(n-1):
  for j in range(i+1,n):
    if a[i] > a[j]:
      cnt1 += 1
cnt1 = cnt1*k

cnt2 = 0
for l in range(n):
  for m in range(n):
    if a[l] > a[m]:
      cnt2 += 1
cnt2 = cnt2*k*(k-1)//2

cnt = cnt1 + cnt2

x = 10**9 + 7
print(int(cnt%x))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = a*k
cnt = 0
for i in range(len(b)-1):
  for j in range(i+1,len(b)):
    if b[i] > b[j]:
      cnt += 1
x = 10**9 + 7
print(cnt%x)
Problem p02936 (python)

Fixed submission:
def main():
  import sys
  input = sys.stdin.readline
  from collections import deque
  
  n,q=map(int,input().split())
  ab=[[] for _ in range(n+1)]
  for _ in range(n-1):
    a,b=map(int,input().split())
    ab[a].append(b)
    ab[b].append(a)
  ans=[0]*(n+1)
  for _ in range(q):
    p,x=map(int,input().split())
    ans[p]+=x
  
  l,parent=deque([1]),[0]*(n+1)
  parent[1]=1
  while l:
    x=l.popleft()
    for i in ab[x]:
      if parent[i]:
        continue
      l.append(i)
      ans[i]+=ans[x]
      parent[i]=1
      
  print(*ans[1:])
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
n,q = int(input().split())
a = []
b = []
for i in range(n-1):
  a1,b1=[int(i) for i in input().split()]
  a.append(a1)
  b.append(b1)
p = []
x = []
for j in range(q):
  p1,x1=[int(j) for j in input().split()]
  p.append(p1)
  x.append(x1)
c = [0]*n
for j in range(q):
  for i in range(n-1):
    if p[j] == a[i]:
      c[a[i]-1] += x[j]
      c[b[i]-1] += x[j]
      for l in range(i,n-1):
        if b[i] == a[l]:
          c[a[l]-1] += x[j]
          c[b[l]-1] += x[j]
print(c)
Problem p02945 (python)

Fixed submission:
a,b = map(int,input().split())
list = [a+b,a-b,a*b]
print(max(list))

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
list = [a+b,a-b,a*b]
print(max(list))

Buggy submission (verdict: Runtime Error):
a,b = int(input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(max(a+b,a-b,a*b))
Problem p02946 (python)

Fixed submission:
k,x = map(int,input().split())
for i in range(x-k+1,x+k):
    print(i,end=' ')

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
c = list(range(k-x+1,k+x)) 
print(" ".join([n for n in c]))
Problem p02952 (python)

Fixed submission:
n = int(input())
count = 0
for i in range(1,n+1):
  if len(str(i))%2 == 1:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count = 0
for i in range(len(n)):
  if len(str(i))%2 == 1:
    count += 1
print(count)
Problem p02983 (python)

Fixed submission:
L,R = map(int,input().split())
if R - L >= 672:
  print(0)
else:
  l = L%2019
  r = R%2019
  if l > r:
    print(0)
  else:
    a = 2018
    for i in range(l,r):
      for j in range(i+1,r+1):
        a = min((i*j)%2019,a)
        if a == 1:
          print(a)
          exit()
    print(a)

Buggy submission (verdict: Runtime Error):
import numpy as np
L,R = map(int,input().split())
x = np.arange(L,R+1)
m = sorted(np.mod(x,2019))
print(m[0]*m[1])
Problem p02999 (python)

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

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(int,input().split())
s = w*h/2
if x == w/2 and y == h/2:
  print(s,1)
else:
  print(s,0)

Buggy submission (verdict: Runtime Error):
x,a = mao(int,input())
if x >= a:
  print(10)
else:
  print(0)
Problem p03085 (python)

Fixed submission:
b=input()
l=['A','C','G','T']
for i in range(4):
  if b==l[i]:
    print(l[3-i])

Buggy submission (verdict: Runtime Error):
b=input()
l=['A','C','G','T']
for i in range(4):
  if b==l[i]:
    print(l[4-i])
Problem p03164 (python)

Fixed submission:
def main():
  import sys
  input = sys.stdin.readline
  n,W=map(int,input().split())
  w,v=[0]*n,[0]*n
  for i in range(n):
    w[i],v[i]=map(int,input().split())
  v_sum=sum(v)
  dp=[[float('inf')]*(v_sum+1) for _ in range(n+1)]
  dp[0][0]=0
  for i in range(n):
    for j in range(v_sum+1):
      dp[i+1][j]=dp[i][j - v[i]] + w[i] if j - v[i]>=0 else dp[i+1][j]
      dp[i+1][j]=min(dp[i+1][j],dp[i][j])
  ans=0
  for j in range(v_sum+1):
    if dp[n][j] <= W:
      ans = j
  print(ans)
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n,w=map(int,input().split())
  wv=[tuple(map(int,input().split())) for _ in range(n)]
  dp=[[0]*(w+1) for _ in range(n+1)]
  for i in range(n):
    for j in range(w+1):
      dp[i+1][j]=max(dp[i][j-wv[i][0]]+wv[i][1],dp[i][j]) if j-wv[i][0]>=0 else dp[i][j]
  print(dp[n][w])
if __name__=='__main__':
  main()
Problem p03206 (python)

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

Buggy submission (verdict: Runtime Error):
D=int(input())
if D=25:
  print('Christmas')
elif D=24:
  print('Christmas Eve')
elif D=23:
  print('Christmas Eve Eve')
elif D=22:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
D=int(input())
if D=25:
  print('Christmas')
elif D=24:
  print('Christmas Eve')
elif D=23:
  print('Christmas Eve Eve')
elif D=22:
  print('Christmas Eve Eve Eve')
Problem p03292 (python)

Fixed submission:
A=list(map(int,input().split()))
A.sort()
print(A[2]-A[0])

Buggy submission (verdict: Runtime Error):
A=list(map(int,input89.split()))
A.sort()
print(A[2]-A[0])
Problem p03352 (python)

Fixed submission:
x=int(input())
ans=0
for i in range(1,32):
  for j in range(2,11):
    if pow(i,j)<=x:
      ans=max(pow(i,j),ans)
print(ans)

Buggy submission (verdict: Runtime Error):
x=int(input())
ans=0
for i in range(1,32):
  for j in range(2,11):
    if pow(i,j)=<x:
      ans=max(pow(i,j),ans)
print(ans)
Problem p03423 (python)

Fixed submission:
n=int(input())
print(n//3)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(x//3)
Problem p03469 (python)

Fixed submission:
s1,s2,s3=input().split('/')
s1='2018'
print(s1+'/'+s2+'/'+s3)

Buggy submission (verdict: Runtime Error):
s=input()
s[3]='8'
print(s)
Problem p03555 (python)

Fixed submission:
c1=input()
c2=input()
if c1[0]==c2[2] and c1[1]==c2[1] and c1[2]==c2[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
c1=input()
c2=input()
if c1[0]==c2[2],c1[1]==c2[1],c1[2]==c2[0]:
  print('Yes')
else:
  print('No')
Problem p03565 (python)

Fixed submission:
s=list(input())
t=list(input())
S,T=len(s),len(t)
t=t+['?']
if S<T:
  print('UNRESTORABLE')
  exit()
count=[0]*S
for i in range(T+1):
  if t[i] in s:
    x=s.index(t[i])
    if all(s[x-i+j]=='?' or s[x-i+j]==t[j] for j in range(T)):
      count[x-i]=1   
if max(count)==0:
  print('UNRESTORABLE')
  exit()
count=count[::-1]
x=count.index(1)
x,j=S-x-1,0
for i in range(S):
  if (i<x or i>x+T-1):
    if s[i]=='?':
      s[i]='a'
  else:
    s[i]=t[j]
    j+=1
print(''.join(s))

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
S,T=len(s),len(t)
t=t+['?']
if S<T:
  print('UNRESTORABLE')
  exit()
c,p=[0]*S,s[::-1]
for i in range(T+1):
  if t[i] in p:
    x=S-p.index(t[i])-1
    c[x-i]=1 if all(s[x-i+j]=='?' or s[x-i+j]==t[j] for j in range(T)) else 0
if max(c)==0:
  print('UNRESTORABLE')
  exit()
c=c[::-1]
x,j=S-c.index(1)-1,0
for i in range(S):
  if (i<x or i>x+T-1):
    s[i]='a' if s[i]=='?' else s[i]
  else:
    s[i],j=t[j],j+1
print(''.join(s))
Problem p03611 (python)

Fixed submission:
def main():
  n=input()
  a=tuple(map(int,input().split()))
  cnt=[0]*(pow(10,5)+2)
  for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
  print(max(set(cnt)))   
if __name__=='__main__':
  main()

Buggy submission (verdict: Runtime Error):
def main():
  import sys
  input = sys.stdin.readline
  n=input()
  a=tuple(map(int,input().split()))
  cnt=[0]*(max(a)+2)
  for i in a:
    cnt[i]+= 1
  print(max(map(sum,zip(cnt,cnt[1:],cnt[2:]))))  
if __name__=='__main__':
  main()
Problem p03623 (python)

Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a)>abs(x-b):
  print('B')
else:
  print('A')

Buggy submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if abs(x-a)>abs(x-b):
  print(B)
else:
  print(A)

Buggy submission (verdict: Runtime Error):
x,a,b=mapt(int,input().split())
if abs(x-a)>abs(x-b):
  print(B)
else:
  print(A)