Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#N is numbers of BAITO, M is limit of days
N,M=map(int,input().split())

i=0
inp ={}
while i<N:
  readTime,inCome=map(int,input().split())
  if readTime in inp:
    inp[readTime].append(inCome)
  else:
    inp[readTime]=[inCome]
  
  i=i+1

#print(inp)  

result=0
pool=[]
i=1
while i<=M:
  if i in inp:
	  pool=pool+inp[i]
  #print(i,pool)
  
  if len(pool)>0:
    result=result+max(pool)
    pool.remove(max(pool))
    #print(pool)
  
  i=i+1
 
print(result)

Fixed submission:
import heapq

#N is numbers of BAITO, M is limit of days
N,M=map(int,input().split())
 
i=0
inp ={}
while i<N:
  readTime,inCome=map(int,input().split())
  if readTime in inp:
    inp[readTime].append(-inCome)
  else:
    inp[readTime]=[-inCome]
  
  i=i+1
 
#print(inp)  
 
result=0
pool=[]
heapq.heapify(pool)
i=1
while i<=M:
  if i in inp:
    for k in inp[i]:
      heapq.heappush(pool,k)
  if len(pool)>0:
    result=result-heapq.heappop(pool)
  i=i+1
 
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
#N is numbers of BAITO, M is limit of days
N,M=map(int,input().split())

i=0
inp ={}
while i<N:
  readTime,inCome=map(int,input().split())
  if readTime in inp:
    inp[readTime].append(inCome)
  else:
    inp[readTime]=[inCome]
  
  i=i+1

#print(inp)  

result=0
pool=[]
i=1
while i<=M:
  if i in inp:
	  pool=pool+inp[i]
  #print(i,pool)
  
  if len(pool)>0:
    result=result+max(pool)
    pool.remove(max(pool))
    #print(pool)
  
  i=i+1
 
print(result)

Fixed submission:
import heapq

#N is numbers of BAITO, M is limit of days
N,M=map(int,input().split())
 
i=0
inp ={}
while i<N:
  readTime,inCome=map(int,input().split())
  if readTime in inp:
    inp[readTime].append(-inCome)
  else:
    inp[readTime]=[-inCome]
  
  i=i+1
 
#print(inp)  
 
result=0
pool=[]
heapq.heapify(pool)
i=1
while i<=M:
  if i in inp:
    for k in inp[i]:
      heapq.heappush(pool,k)
  if len(pool)>0:
    result=result-heapq.heappop(pool)
  i=i+1
 
print(result)
Buggy python submission (verdict: Runtime Error):
n=int(input())
r=list(map(int,input().split()))
a=sorted(r)

r="".join(r)
a="".join(a)

count=0
i=0
while i<len(r):
  if r[i]!=r[i]:count+=1
    
print("Yes" if count<=2 else "No")


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

i=1
count=0
for item in r:
  if item!=i:count+=1
  i+=1

print("YES" if count<3 else "NO")
Buggy python submission (verdict: Runtime Error):
import math

n,d=map(int,input().split())

print(math.ceil(n/(2d+1.0)))


Fixed submission:
import math

n,d=map(int,input().split())

print(math.ceil(n/(2*d+1.0)))
Buggy python submission (verdict: Runtime Error):
s=input()
print("Yes" if s.count(s[0])==2 and s.count(s[1])==2 s.count(s[2])==2 s.count(s[3])==2 else "No"   )

Fixed submission:
s=input()
print("Yes" if s.count(s[0])==2 and s.count(s[1])==2 and s.count(s[2])==2 and s.count(s[3])==2 else "No"   )
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())

s=[0]*n

for _ in range(m):
  s[int(input())-1]=""
  
#print(s)

if n==1:
  print(1)
  exit()
elif n==2:
  if s[0]=="":
    print(1)
  else:
    print(2)
  exit()
  
if s[0]=="":
  s[0]=0
else:
  s[0]=1
  
if s[1]=="":
  s[1]=0
else:
  s[1]=1+s[0]

i=2
while i<n:
  if s[i]=="":
    s[i]=0
  else:
    s[i]=s[i-1]+s[i-2]
  i+=1
print(s[-1]%1000000007)

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

s=abs(sum(r[:1])-sum(r[1:]))

for i in range(1,n):
  s=min(s,abs(sum(r[:i])-sum(r[i:])))
        
print(s)
Buggy python submission (verdict: Runtime Error):

a,b=map(int,input().split())
s=input()

s[b-1]=s[b-1].lower()
print(s)

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

print(s[:b-1]+s[b-1].lower()+s[b:])
Buggy python submission (verdict: Runtime Error):
a=input()

if len(a)==1:
  print(0)
  exit()
  
b=[::2]
c=[1::2]

b0=b.count("0")
b1=b.count("1")
c0=c.count("0")
c1=c.count("1")

print(min(b0+c1,b1+c0))

Fixed submission:
a=input()

if len(a)==1:
  print(0)
  exit()
  
b=a[::2]
c=a[1::2]

b0=b.count("0")
b1=b.count("1")
c0=c.count("0")
c1=c.count("1")

print(min(b0+c1,b1+c0))
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input())
h,w=map(int,input())

print(H*w+W*h-h*w)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())

print(H*W-(H*w+W*h-h*w))
Buggy python submission (verdict: Runtime Error):
n=int(input())

result=0
for item in range(n):
  a,b=map(str,input().split())
  if b=="JPY":
    result+=int(a)
  else:
    result+=int(a)*380000.0
print(result)

Fixed submission:
n=int(input())

result=0
for item in range(n):
  a,b=map(str,input().split())
  if b=="JPY":
    result+=float(a)
  else:
    result+=float(a)*380000.0
print(result)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input.split())
print(a*b//2)

Fixed submission:
a,b,c=map(int,input().split())
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ashiba=list(map(int,input()))

cost=[0]*n

for item in range(1:n):
  print(item)

Fixed submission:
n=int(input())
cost=list(map(int,input().split()))
 
ashiba=[0]*n
ashiba[1]=abs(cost[1]-cost[0])
#print(ashiba)
i=2
result=0
while i<n:
  ashiba[i]=min(abs(cost[i]-cost[i-1])+ashiba[i-1],abs(cost[i]-cost[i-2])+ashiba[i-2])
  #print(i,ashiba)
  i=i+1
  
print(ashiba[n-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:print("Hello World")
print(int(input())+int(input()))


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
print("Hello World" if n==1)
print(int(input())+int(input()))


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
print("Hello World" if n==1 else str(a+b))


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

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
print("Hello World" if n==1 else a+b)

Fixed submission:
n=int(input())
if n==1:print("Hello World")
else:print(int(input())+int(input()))
Buggy python submission (verdict: Runtime Error):
n=int(input())
r=[list(map(int,input().split())) for _ in range(N)]
r.sort(key=lambda x:x[2])
x,y,h=r[-1]

for X in range(101):
  for Y in range(101):
    H = h + abs(X-x) + abs(Y-y)
    if all(k==max(H-abs(X-i)-abs(Y-j),0) for i,j,k in r):
      print(i,j,k)
      exit()

Fixed submission:
n=int(input())
#(x,y,h)
r=sorted([list(map(int,input().split()))[::-1] for _ in range(n)])[::-1]

for i in range(101):
  for j in range(101):
    h1=r[0][0]+abs(r[0][1]-i)+abs(r[0][2]-j)
    flag=0
    for item in r[1:]:
      if item[0]>0:
        if item[0]+abs(item[1]-i)+abs(item[2]-j)!=h1:
          flag=1
          break
      else:
        if h1-abs(item[1]-i)-abs(item[2]-j)>0:
          flag=1
          break
    if flag==0:
      print(j,i,h1)
      exit()
Buggy python submission (verdict: Runtime Error):
import collections

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2])
oNum=collections.Counter(r[::2])


if list(eNum)[0]==list(oNum)[0]:
  print(len(r)-max(eNum[list(eNum)[0]]+oNum[list(oNum)[1]],eNum[list(eNum)[1]]+oNum[list(oNum)[0]]))
else:
  print(len(r)-eNum[list(eNum)[0]]-oNum[list(oNum)[0]])


Fixed submission:
import collections

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2]).most_common()
oNum=collections.Counter(r[::2]).most_common()
eNum.append((0,0))
oNum.append((0,0))



if eNum[0][0]==oNum[0][0]:
  print(len(r)-max(eNum[0][1]+oNum[1][1],eNum[1][1]+oNum[0][1]))
else:
  print(len(r)-eNum[0][1]-oNum[0][1])

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

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2])
oNum=collections.Counter(r[::2])


if eNum.keys()[0]==oNum.keys()[0]:
  print(len(r)-max(eNum[eNum.keys()[0]]+oNum[oNum.keys()[1]],eNum[eNum.keys()[1]]+oNum[oNum.keys()[0]]))
else:
  print(len(r)-eNum[eNum.keys()[0]]-oNum[oNum.keys()[1]])

Fixed submission:
import collections

n=int(input())
r=list(map(int,input().split()))

eNum=collections.Counter(r[1::2]).most_common()
oNum=collections.Counter(r[::2]).most_common()
eNum.append((0,0))
oNum.append((0,0))



if eNum[0][0]==oNum[0][0]:
  print(len(r)-max(eNum[0][1]+oNum[1][1],eNum[1][1]+oNum[0][1]))
else:
  print(len(r)-eNum[0][1]-oNum[0][1])
Buggy python submission (verdict: Runtime Error):
r=sorted(map(int,input().split()))[-1]

print(r[0]-r[2])

Fixed submission:
r=sorted(map(int,input().split()))[::-1]

print(r[0]-r[2])
Buggy python submission (verdict: Runtime Error):
int(input())
print(-1*int(input())+sum(list(map(int,input().split()))))


Fixed submission:
n=int(input())
print(sum(list(map(int,input().split())))-n)
Buggy python submission (verdict: Runtime Error):
a,b =map(int,input.split())
print(":(" if a>8 or b>8 else "Yay!")

Fixed submission:
a,b =map(int,input().split())
print(":(" if a>8 or b>8 else "Yay!")
Buggy python submission (verdict: Runtime Error):
print("ABD" int(input())>999 else "ABC")

Fixed submission:
print("ABD" if int(input())>999 else "ABC")
Buggy python submission (verdict: Runtime Error):
N=int(input())
i=0

flag=0
beforeTxy=[0,0,0]
while i<N:
  afterTxy=list(map(int,input().split()))
  #print(afterTxy)
  unk=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])-abs(afterTxy[2]-beforeTxy[2])
  unk2=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])

  if unk>=0 and unk%2!=0 and unk2%2!=0:
    flag=1
  beforeTxy=afterTxy
  i=i+1

if flag==0:
  print("Yes")
else:
  print("No")

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

flag=0
beforeTxy=[0,0,0]
while i<N:
  afterTxy=list(map(int,input().split()))
  #print(afterTxy)
  unk=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])-abs(afterTxy[2]-beforeTxy[2])
  unk2=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])

  if unk>=0 and unk%2!=0 and unk2%2!=0:
    flag=1
  beforeTxy=afterTxy
  i=i+1

if flag==0:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
i=0
 
flag=0
beforeTxy=[0,0,0]
while i<N:
  afterTxy=list(map(int,input().split()))
  #print(afterTxy)
  #unk=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])-abs(afterTxy[2]-beforeTxy[2])
  #unk2=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])
  dt=afterTxy[0]-beforeTxy[0]
  dist=abs(afterTxy[1]-beforeTxy[1])+abs(afterTxy[2]-beforeTxy[2])
  #print(dt,dist)
  if dt < dist or dt%2!=dist%2:
    flag=1
  beforeTxy=afterTxy
  i=i+1
 
if flag==0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
i=0

flag=0
beforeTxy=[0,0,0]
while i<N:
  afterTxy=list(map(int,input().split()))
  #print(afterTxy)
  unk=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])-abs(afterTxy[2]-beforeTxy[2])
  unk2=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])

  if unk>=0 and unk%2!=0 and unk2%2!=0:
    flag=1
  beforeTxy=afterTxy
  i=i+1

if flag==0:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())
i=0
 
flag=0
beforeTxy=[0,0,0]
while i<N:
  afterTxy=list(map(int,input().split()))
  #print(afterTxy)
  #unk=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])-abs(afterTxy[2]-beforeTxy[2])
  #unk2=afterTxy[0]-beforeTxy[0]-abs(afterTxy[1]-beforeTxy[1])
  dt=afterTxy[0]-beforeTxy[0]
  dist=abs(afterTxy[1]-beforeTxy[1])+abs(afterTxy[2]-beforeTxy[2])
  #print(dt,dist)
  if dt < dist or dt%2!=dist%2:
    flag=1
  beforeTxy=afterTxy
  i=i+1
 
if flag==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
dic={}
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]+=1
  else:
    dic[r]=1

n=int(input())
for _ in range(n):
  r=input()
  if r in dic:
    dic[r]-=1
  else:
    dic[r]=-1

print(max(dic.values(),0))

Fixed submission:
a,b=map(int,input().split())
s=input().split("-")
s.append("-")

if len(s[0])==a and len(s[1])==b and s[1].isalnum() and s[0].isalnum():
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
i=0
sum=0
for i<len(str(a)):
  if str(a)[i]=="1":
    sum=sum+1
  i=i+1
  
print(sum)

Fixed submission:
a = int(input())
i=0
sum=0
while i<len(str(a)):
  if str(a)[i]=="1":
    sum=sum+1
  i=i+1
  
print(sum)

Buggy python submission (verdict: Runtime Error):
a = int(input())
i=0
sum=0
for i<len(str(a)):
  if str(a)[i]==1:
    sum=sum+1
  i=i+1
  
print(sum)

Fixed submission:
a = int(input())
i=0
sum=0
while i<len(str(a)):
  if str(a)[i]=="1":
    sum=sum+1
  i=i+1
  
print(sum)

Buggy python submission (verdict: Runtime Error):
a = int(input())
i=0
sum=0
for i<len(a):
  if str(a)[i]==1:
    sum=sum+1
  i=i+1
  
print(sum)

Fixed submission:
a = int(input())
i=0
sum=0
while i<len(str(a)):
  if str(a)[i]=="1":
    sum=sum+1
  i=i+1
  
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
h,w=map(int,input().split())

r=[list(map(int,input().split())) for _ in range(10)]

route={i:10**3 for i in range(10)}
route[1]=0
route[-1]=0
nonFixPosi=set([0,2,3,4,5,6,7,8,9])
FixPosi=set([1])

while len(nonFixPosi)>0:
  for i in nonFixPosi:
    temp=[route[i]]
    for j in FixPosi:
      temp.append(r[i][j]+route[j])
    route[i]=min(temp)
  
  minKey=[]
  minValue=10*4
  for i in nonFixPosi:
    if route[i]==minValue:
      minKey.append(i)
    elif route[i]<minValue:
      minKey=[i]
      minValue=route[i]
  for item in minKey:
    nonFixPosi.remove(item)
    FixPosi.add(item)
  #print(FixPosi)
#print(route)

result=0
for _ in range(h):
  k=list(map(int,input().split()))
  for item in k:
    result+=route[item]
    
print(result)


Fixed submission:
import collections

h,w=map(int,input().split())

r=[list(map(int,input().split())) for _ in range(10)]

route={i:10**3 for i in range(10)}
route[1]=0
nonFixPosi=set([0,2,3,4,5,6,7,8,9])
FixPosi=set([1])

for _ in range(11):
  for i in nonFixPosi:
    temp=[route[i]]
    for j in FixPosi:
      temp.append(r[i][j]+route[j])
    route[i]=min(temp)
  
  minKey=[]
  minValue=10**4
  for i in nonFixPosi:
    if route[i]==minValue:
      minKey.append(i)
    elif route[i]<minValue:
      minKey=[i]
      minValue=route[i]
  for item in minKey:
    nonFixPosi.remove(item)
    FixPosi.add(item)
  if len(nonFixPosi)<=0:
    break
    
result=[]
for _ in range(h):
  result+=list(map(int,input().split()))
k=collections.Counter(result)
#print(k)
val=0
for i in range(10):
  val+=k[i]*route[i]

print(val)
Buggy python submission (verdict: Time Limit Exceeded):
n=input()
a=list(map(str,input().split()))
result=""
i=0
while i<len(a):
  if len(a)%2!=0:
    if i%2==0:
      result=a[i]+","+result
    else:
      result=result+","+a[i]
  else:
    if i%2==0:
      result=result+","+a[i]
    else:
      result=a[i]+","+result
  #print(result)
  i=i+1

print(*result.replace(",,",",").split(","))

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

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
a=list(map(int,input().split()))
result=[]
i=0
while i<len(a):
  if len(a)%2!=0:
    if i%2==0:
      result=[a[i]]+result
    else:
      result=result+[a[i]]
  else:
    if i%2==0:
      result=result+[a[i]]
    else:
      result=[a[i]]+result
  i=i+1

print(*result)


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

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
a=list(map(int,input().split()))
result=[]
i=0
while i<len(a):
  if len(a)%2!=0:
    if i%2==0:
      result=[a[i]]+result
    else:
      result=result+[a[i]]
  else:
    if i%2==0:
      result=result+[a[i]]
    else:
      result=[a[i]]+result
  i=i+1

print(*result)

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

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

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

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

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

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
a=list(map(int,input().split()))
result=[]
for item in a:
  result.append(item)
  result=result[::-1]

print(*result)

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

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
a=list(map(int,input().split()))
result=[]
for item in a:
  result.append(item)
  result=result[::-1]

print(*result)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
b=a[::-2]+a[N%2::2]
print(*b)
Buggy python submission (verdict: Runtime Error):
print("A%sC",%input().split()[0])

Fixed submission:
print("A%sC"%input()[8])

Buggy python submission (verdict: Runtime Error):
print("A%sC",%input()[8])

Fixed submission:
print("A%sC"%input()[8])
Buggy python submission (verdict: Runtime Error):
S=input()

result=[]

for s in S:
  print(result)
  #if s=="B":
    if len(result)>0:
      #print("nBack")
      result.pop()
  else:
    result.append(s)

print(*result)

Fixed submission:
S=input()

result=[]

for s in S:
  #print(result)
  if s=="B":
    if len(result)>0:
      #print("nBack")
      result.pop()
  else:
    result.append(s)

print(*result,sep="")
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=a+b
if c=3:
    print(3)
elif c=4:
    print(2)
else:
    print(1)


Fixed submission:
a=int(input())
b=int(input())
c=a+b
if c==3:
    print(3)
elif c==4:
    print(2)
else:
    print(1)

Buggy python submission (verdict: Runtime Error):
a=int,input()
b=int,input()
c=a+b
if c=3:   
    print(3)
elif c=5:
    print(1)
else:
    print(2)

Fixed submission:
a=int(input())
b=int(input())
c=a+b
if c==3:
    print(3)
elif c==4:
    print(2)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12) and (1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12) and (b=0 or 13<b):
      print('MMYY')
elif (1<=b<=12) and (a=0 or 13<a):
      print('YYMM')
else:
      print('NA')

Fixed submission:
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12)and(1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12)and(b==0 or b>12):
  print('MMYY')
elif (a==0 or a>12)and(1<=b<=12):
  print('YYMM')
else:
  print('NA')

Buggy python submission (verdict: Runtime Error):
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12 and 1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12 and (b=0 or 13<b):
      print('MMYY')
elif (1<=b<=12 and (a=0 or 13<a):
      print('YYMM')
else:
      print('NA')

Fixed submission:
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12)and(1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12)and(b==0 or b>12):
  print('MMYY')
elif (a==0 or a>12)and(1<=b<=12):
  print('YYMM')
else:
  print('NA')

Buggy python submission (verdict: Runtime Error):
s=input()
a=int(s[0:1])
b=int(s[2:3])
if (1<=a<=12 and 1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12 and (b=0 or 13<b):
      print('MMYY')
elif (1<=b<=12 and (a=0 or 13<a):
      print('YYMM')
else:
      print('NA')

Fixed submission:
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12)and(1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12)and(b==0 or b>12):
  print('MMYY')
elif (a==0 or a>12)and(1<=b<=12):
  print('YYMM')
else:
  print('NA')

Buggy python submission (verdict: Runtime Error):
s=input()
a=s[:1]
b=s[2:]
if (1<=a<=12 and 1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12 and (b=0 or 13<b):
      print('MMYY')
elif (1<=b<=12 and (a=0 or 13<a):
      print('YYMM')
else:
      print('NA')

Fixed submission:
s=input()
a=int(s[:2])
b=int(s[2:])
if (1<=a<=12)and(1<=b<=12):
  print('AMBIGUOUS')
elif (1<=a<=12)and(b==0 or b>12):
  print('MMYY')
elif (a==0 or a>12)and(1<=b<=12):
  print('YYMM')
else:
  print('NA')
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
c = a! / (b! * (a - b)!)
print(c)

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

Buggy python submission (verdict: Runtime Error):
a,b=

Fixed submission:
a,b=map(int,input().split())
c=a-b+1
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,c,k = map(int,input().split())


ka = k - a
if ka > 0:
    kb = ka - b
print(a*1+ka*0+kb*-1)



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


ka = k - a

if ka > 0:
    kb = ka - b
elif ka <= 0:
    a = k
    ka = 0
    kb = 0
else:
    kb = 0
print(a*1+ka*0+kb*-1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int,input().split())

total = 0
for i in range(k):
    if a > 0:
        total += 1
        a -= 1
    elif b > 0:
        total += 0
        b -= 1
    elif c > 0:
        total -= 1
        c -= 1
print(total)

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


ka = k - a

if ka > 0:
    kb = ka - b
elif ka <= 0:
    a = k
    ka = 0
    kb = 0
else:
    kb = 0
print(a*1+ka*0+kb*-1)
Buggy python submission (verdict: Runtime Error):
s = int(input())
if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Fixed submission:
s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Runtime Error):
x = int(input())

def f(x,b):
    return int((x+b**5)**(1/5))

b=0
plus=1
while True:
    ans = f(x,b)
    print(ans)
    if ans**5-b**5 == x:
        print(ans, b)
        break
    elif plus == 1:
        b=b*(-1)
        plus = 0
    elif plus == 0:
        b=b*(-1)
        b+=1
        plus = 1

Fixed submission:
def solve():
   x = int(input())
   for a in range(-500,500):
      for b in range(-500,500):
         n = a**5 - b**5
         if n == x:
            print(a,end=" ")
            print(b)
            return
solve()

Buggy python submission (verdict: Runtime Error):
import math
x = int(input())

def f(x,b):
    return math.floor((x+b**5)**(1/5))

b=0
plus=1
while True:
    ans = f(x,b)
    print(ans)
    if ans**5-b**5 == x:
        print(ans, b)
        break
    elif plus == 1:
        b=b*(-1)
        plus = 0
    elif plus == 0:
        b=b*(-1)
        b+=1
        plus = 1

Fixed submission:
def solve():
   x = int(input())
   for a in range(-500,500):
      for b in range(-500,500):
         n = a**5 - b**5
         if n == x:
            print(a,end=" ")
            print(b)
            return
solve()

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())

def f(x,b):
    return int((x+b**5)**(1/5))

b=0
plus=1
while True:
    ans = f(x,b)
    #print(ans)
    if ans**5-b**5 == x:
        print(ans, b)
        break
    elif plus == 1:
        b=b*(-1)
        plus = 0
    elif plus == 0:
        b=b*(-1)
        b+=1

Fixed submission:
def solve():
   x = int(input())
   for a in range(-500,500):
      for b in range(-500,500):
         n = a**5 - b**5
         if n == x:
            print(a,end=" ")
            print(b)
            return
solve()
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list()
for i in range(N):
  x = input()
  S.append(x)
  
A = set(S)
print(len(A))

Fixed submission:
S,W = map(int,input().split())
if W >= S:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = list(map(int,input().split()))
for i in range(N):
  i += 1
  print(A.count(i))

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
import collections
c = collections.Counter(A)
for i in range(N):
  i+=1
  print(c[i])
Buggy python submission (verdict: Runtime Error):
li = int(input().split())
list = []
list.append(li[2])
list.append(li[0])
list.append(li[1])
print(list)

Fixed submission:
x,y,z = map(int,input().split())
print(z, x, y)