Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,t=map(int,input().split());c=[]
for i in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c.append(a)
c.sort();print(c[0])

Fixed submission:
n,t=map(int,input().split());c=[]
for i in range(n):
  a,b=map(int,input().split())
  if b<=t:
    c.append(a)
if c==[]:print("TLE")
else:c.sort();print(c[0])
Buggy python submission (verdict: Runtime Error):
def divisor(n):
  ass=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      ass.append(i)
      if i!=n//i:ass.append(n//i)
  return ass
n,m=map(int,input().split())
d=divisor(m)
d.sort(reverse=1)
for i in d:
  if m//i>=n:print(i):exit()

Fixed submission:
def divisor(n):
  ass=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      ass.append(i)
      if i!=n//i:ass.append(n//i)
  return ass
n,m=map(int,input().split())
d=sorted(divisor(m))
for i in d[::-1]:
  if m//i>=n:print(i);break
Buggy python submission (verdict: Runtime Error):
a=list(map(int,input().split));print(sum(a)+max(a)*9)

Fixed submission:
a=list(map(int,input().split()));print(sum(a)+max(a)*9)
Buggy python submission (verdict: Time Limit Exceeded):
s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")

Fixed submission:
s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
s,t=input(),input()
rs=rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  if rs[a(s[i])]=="":rs[a(s[i])]=t[i]
  elif rs[a(s[i])]!=t[i]:print("No");exit()
  if rt[a(t[i])]=="":rt[a(t[i])]=s[i]
  elif rt[a(t[i])]!=s[i]:print("No");exit()
rint("Yes")

Fixed submission:
s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
s,t=input(),input()
d={"a":0,"b":0,"c":0,"d":0,"e":0,"f":0,"g":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}
for i,j in s,t:
  if d[i]==0:d[i]=j
  elif d[i]!=j:print("No");exit()
  if d[j]==0:d[j]=i
  elif d[j]!=i:print("No");exit()
print("Yes")


Fixed submission:
s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
s,t=input(),input()
d={"a":0,"b":0,c"":0,"d":0,"e":0,"f":0,g"":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}
for i,j in s,t:
  if d[i]==0:d[i]=j
  elif d[i]!=j:print("No");exit()
  if d[j]==0:d[j]=i
  elif d[j]!=i:print("No");exit()
print("Yes")

Fixed submission:
s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
print("Yes"if (int(input())+int(input()))%2==0 else"No")

Fixed submission:
a,b=map(int,input().split());print("Yes"if a%2==b%2==1 else"No")
Buggy python submission (verdict: Runtime Error):
n,w=int(input()),[input()for i in range(n)]
def sortex(X):
  b=sorted(X)
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
if len(w)!=len(sortex(w)):
  print("No")
  exit()
for i in range(len(w)-1):
  if w[i][-1]!=w[i+1][0]:
    print("No")
    exit()
print("Yes")

Fixed submission:
n=int(input());w=[input()for i in range(n)]
def sortex(X):
  b=sorted(X)
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
if len(w)!=len(sortex(w)):
  print("No")
  exit()
for i in range(len(w)-1):
  if w[i][-1]!=w[i+1][0]:
    print("No")
    exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,input().split());x3,y3,x4,y4=x2-(y2-y1),y2+(x2-x1),x3-(x2-x1),y3-(y2-y1);print(x3,y3,x4,y4)

Fixed submission:
x1,y1,x2,y2=map(int,input().split());x3,y3=x2-(y2-y1),y2+(x2-x1);x4,y4=x3-(x2-x1),y3-(y2-y1);print(x3,y3,x4,y4)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
k-=1
x=list(map(int,input().split()))
print(min(min(abs(x[i],x[i+k]))+abs(x[i]-x[i+k])for i in range(n-k)))

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=abs(a[0])*2+abs(a[-1])*2#とりあえず最大
for i in range(n-k+1):
  x,y=a[i],a[i+k-1]
  if x*y<0:m=min(abs(x),y)*2+max(abs(x),y)
  else:m=max(abs(x),abs(y))
  ans=min(ans,m)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans,i="",0
while n!=0:
  if (n-(-2)**i)%((-2)**(i+1))==0:ans="1"+ans;n-=(-2)**i
  else:ans="0"+ans
  i+=1
print(int(ans))

Fixed submission:
n=int(input())
if n==0:print(0);exit()
ans,i="",0
while n!=0:
  if (n-(-2)**i)%((-2)**(i+1))==0:ans="1"+ans;n-=(-2)**i
  else:ans="0"+ans
  i+=1
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n=int(input());a=list(map(int,input().split()));c,ans=1,0
for i in range(n-1)
  if a[i]==a[i+1]:c+=1
  else:
    if c>=2:ans+=c//2
    c=1
print(ans)

Fixed submission:
n=int(input());a=list(map(int,input().split()));c,ans=1,0
for i in range(n-1):
  if a[i]==a[i+1]:c+=1
  else:
    if c>=2:ans+=c//2
    c=1
if c>=2:ans+=c//2
print(ans)
Buggy python submission (verdict: Runtime Error):
s,a=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)

Fixed submission:
s,n=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
print(4-input().count()*2)

Fixed submission:
print(4-input().count("-")*2)
Buggy python submission (verdict: Runtime Error):
n,k,*_=open(0);print(((int(n)-2)//(int(k)-1))+1)

Fixed submission:
n,k=input().split();print(((int(n)-2)//(int(k)-1))+1)
Buggy python submission (verdict: Runtime Error):
if max(int(input()),int(input()))>8:print(":(")
else:print("Yay!")

Fixed submission:
a,b=map(int,input().split())
if max(a,b)>8:print(":(")
else:print("Yay!")
Buggy python submission (verdict: Runtime Error):
n=int(input());minn=100
def digit_sum(x):
  a,b=0,str(x)
  for i in range(len(b)):a+=int(b[i])
  return a
for i in range(1,n//2+1):
  a=digit_sum(i),digit_sum(n-i)
  minn=min(100,a)
print(minn)

Fixed submission:
n=int(input());minn=100
def digit_sum(x):
  a,b=0,str(x)
  for i in range(len(b)):a+=int(b[i])
  return a
for i in range(1,n//2+1):a=digit_sum(i)+digit_sum(n-i);minn=min(minn,a)
print(minn)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b,k=map(int,input().split())
mod=998244353
f=[1]
for i in range(n):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod
ans=0
for ac in range(k//a+1):
  asum=ac*a
  if (k-asum)%b:continue
  bc=(k-asum)//b
  if max(ac,bc)>n:continue
  ans=(ans+comb(n,ac)*comb(n,bc))%mod
print(ans)

Fixed submission:
n,a,b,k=map(int,input().split())
mod=998244353
f=[1]
for i in range(n):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod
ans=0
for ac in range(k//a+1):
  asum=ac*a
  if (k-asum)%b:continue
  bc=(k-asum)//b
  if max(ac,bc)>n:continue
  ans=(ans+comb(n,ac)*comb(n,bc))%mod
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or abs(a-b)<=d>=abs(b-c):print("Yes")
else:print("No")

Fixed submission:
a,b=map(int,input().split());print(max(max(a+b,a-b),a*b))
Buggy python submission (verdict: Runtime Error):
n,s=int(input()),input()
a=[s[0]=="E"]
for i in s[1:]:a.append(a[-1]+(i=="E"))
m=999999
for i in range(n):m=min(m,a[:i]+((n-i-1)-(a[-1]-a[i])))
print(m)


Fixed submission:
n,s=int(input()),input()
a=[0]
for i in s:a.append(a[-1]+(i=="W"))
m=999999
for i in range(1,n+1):m=min(m,a[i-1]+((n-i)-(a[-1]-a[i])))
print(m)

Buggy python submission (verdict: Runtime Error):
n,s=int(input()),input()
a=[s[0]=="E"]
for i in s[1:]:a.append(a[-1]+i=="E")
m=999999
for i in range(n):m=min(m,a[:i]+((n-i-1)-(a[-1]-a[i])))
print(m)

Fixed submission:
n,s=int(input()),input()
a=[0]
for i in s:a.append(a[-1]+(i=="W"))
m=999999
for i in range(1,n+1):m=min(m,a[i-1]+((n-i)-(a[-1]-a[i])))
print(m)
Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=list(map(int,input().split()))
ans=10**10
for y in a:
	t=[[]]
	for i in a:
		if i<y:
			if len(t[-1]):t.append([])
		else:
			t[-1].append(i)
	if len(t[-1])==0:del t[-1]
	co=0
	m=[]
	for i in range(len(t)):
		co+=max(len(t[i])-k+1,0)
		t[i].sort()
		m+=t[i][:-k+1]
	if co<q:continue
	m.sort()
	ans=min(ans,m[q-1]-y)
print(ans)

Fixed submission:
n,k,q=map(int,input().split())
a=list(map(int,input().split()))
ans=10**10
for x in a:
  b=[[]]
  can=0
  for i in a:
    if i<x:
      if len(b[-1]):b.append([])
    else:b[-1].append(i)
  if len(b[-1])==0:del b[-1]
  for i in range(len(b)):b[i].sort()
  c=[]
  for i in b:
    i.sort()
    if len(i)>=k:c+=i[:len(i)-k+1]
  if len(c)<q:continue
  c.sort()
  ans=min(ans,c[q-1]-c[0])
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or abs(a-b)<=d=>abs(b-c):print("Yes")
else:print("No")

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or (abs(a-b)<=d and d>=abs(b-c)):print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
a={}
for i in range(k):
  for j in range(len(s)-i):a.append(s[j:j+i+1])
print(sorted(list(a))[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(k):
  for j in range(len(s)-i):a.append(s[j:j+i+1])
a.sort()
for i in range(1,len(a)):
  if a[-i]==a[-i-1]:del a[-i]
print(a[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
n=len(s)
ans=set()
for i in range(1,n+1):
  for j in range(n-i+1):ans.add(s[j:j+i])
ans=sorted(list(set(ans)))
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
n=len(s)
ans=set()
for i in range(1,n+1):
  for j in range(n-i+1):ans.add(s[j:j+i])
ans=sorted(list(set(ans)))
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(1,n+1):
  for j in range(n-i+1):ans.append(s[j:j+i])
ans=sorted(list(set(ans)))
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(1,n+1):
  for j in range(n-i+1):ans.append(s[j:j+i])
  if len(ans)>=k:break
ans=sorted(list(set(ans)))
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(1,n+1):
  for j in range(n-i+1):ans.append(s[j:j+i])
ans=sorted(list(set(ans)))
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
a={s}
for i in range(k):
  for j in range(len(s)-i):a.add(s[j:j+i+1])
print(sorted(list(a))[k-1])
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split())),int(input());print(sum(a)+max(a)*((2**x)-1)

Fixed submission:
a,x=list(map(int,input().split())),int(input());print(sum(a)+max(a)*((2**x)-1))

Buggy python submission (verdict: Runtime Error):
a,x=list(map(int,input().split()),int(input());print(sum(a)+max(a)*((2**x)-1)

Fixed submission:
a,x=list(map(int,input().split())),int(input());print(sum(a)+max(a)*((2**x)-1))
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
b=[list("."*(w+2))]
for i in range(w):
  b.append(list("."+input()+"."))
b.append(list("."*(w+2)))
ans="Yes"
dx=[0,1,0,-1]
dy=[1,0,-1,0]
for i in range(1,h+1):
  for j in range(1,w+1):
    if b[i][j]==".":continue
    flag=True
    for x,y in zip(dx,dy):
      if b[i][j]==b[i+x][j+y]:flag=False
    if flag:ans="No"
print(ans)

Fixed submission:
h,w=map(int,input().split());a=[input()for i in range(h)]
def che(i,j):
  global h,w,a
  if i==0:
    if a[i+1][j]=="#":return
  elif i==h-1:
    if a[i-1][j]=="#":return
  else:
    if a[i-1][j]=="#"or a[i+1][j]=="#":return
  print("No");exit()
for i in range(h):
  s=a[i]
  if s[:2]=="#.":che(i,0)
  if s[-2:]==".#":che(i,w-1)
  for j in range(w-2):
    if s[j]+s[j+1]+s[j+2]==".#.":che(i,j+1)
print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
def aCb(a,b):return len(list(itertools.combinations([0]*a,b)))#組み合わせ
n,a=int(input()),list(map(int,input().split()));b=[0]#入力
b+=list(itertools.accumulate(a))#累積和
b.sort();c=1;ans=0
for i in range(n):#2個以上存在する要素があるとき、cC2を加える
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=aCb(c,2)
    c=1
if c>=2:ans+=aCb(c,2)#アレ対策
print(ans)

Fixed submission:
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in range(n):b.append(b[i]+a[i])
b.sort();c=1;ans=0
for i in range(n):
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=(c*(c-1))//2
    c=1
if c>=2:ans+=(c*(c-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
def aCb(a,b):return len(list(itertools.combinations([0]*a,b)))
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in a:b.append(b[-1]+i)
b.sort();c=1;ans=0
for i in range(n):
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=aCb(c,2)
    c=1
if c>=2:ans+=aCb(c,2)
print(ans)

Fixed submission:
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in range(n):b.append(b[i]+a[i])
b.sort();c=1;ans=0
for i in range(n):
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=(c*(c-1))//2
    c=1
if c>=2:ans+=(c*(c-1))//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
def aCb(a,b):return len(list(itertools.combinations([0]*a,b)))
def ex(X):
  b=X[:]
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in a:b.append(b[-1]+i)
b.sort();d=ex(b);c=0;ans=0
for i in d:
  x=b.count(i)
  if x>=2:ans+=aCb(x,2)
print(ans)

Fixed submission:
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in range(n):b.append(b[i]+a[i])
b.sort();c=1;ans=0
for i in range(n):
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=(c*(c-1))//2
    c=1
if c>=2:ans+=(c*(c-1))//2
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
def aPb(a,b):return(math.factorial(a)//math.factorial(a-b))
def aCb(a,b):return(aPb(a,b)//math.factorial(b))
def ex(X):
  b=X[:]
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in a:b.append(b[-1]+i)
b.sort();d=ex(b)
c=0;ans=0
for i in d:ans+=aCb(b.count(i),2)
print(ans)

Fixed submission:
n,a=int(input()),list(map(int,input().split()));b=[0]
for i in range(n):b.append(b[i]+a[i])
b.sort();c=1;ans=0
for i in range(n):
  if b[i]==b[i+1]:c+=1
  else:
    if c>=2:ans+=(c*(c-1))//2
    c=1
if c>=2:ans+=(c*(c-1))//2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[input()for _ in range(n)]
def check(s,t):
  for i in range(n):
    for j in range(n):
      if s[(i+t)%n][j]!=s[(j+t)%n][i]:return False
  return True
ans=0
for i in range(n):
  if check(s,i):ans+=n
print(ans)

Fixed submission:
n=int(input())
s=[input()for _ in range(n)]
def check(s,t):
  for i in range(n):
    for j in range(n):
      if s[(i+t)%n][j]!=s[(j+t)%n][i]:return False
  return True
ans=0
for i in range(n):
  if check(s,i):ans+=n
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[input()for _ in range(n)]
def check(s):
  for i in range(n):
    for j in range(n):
      if s[i][j]!=s[j][i]:return False
  return True
ans=0
for i in range(n):
  if check(s):ans+=n
  s=s[1:]+s[:1]
print(ans)

Fixed submission:
n=int(input())
s=[input()for _ in range(n)]
def check(s,t):
  for i in range(n):
    for j in range(n):
      if s[(i+t)%n][j]!=s[(j+t)%n][i]:return False
  return True
ans=0
for i in range(n):
  if check(s,i):ans+=n
print(ans)
Buggy python submission (verdict: Runtime Error):

for i in range(10):
	 s=i
	print(s)

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

Buggy python submission (verdict: Runtime Error):
s=input()
if s="ooo":
   if s="ooo":
	   print(1000)

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

Buggy python submission (verdict: Runtime Error):
s=input()
if s="ooo"print(1000)

Fixed submission:
print(input().count("o")*100+700)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
for i in range(len(a)):
  b=a.copy()
  del b[i]
  b.sort()
  print(b[(len(a)//2)-1])

Fixed submission:
n,a=int(input()),list(map(int,input().split()))
b=sorted(a[:])
x,y=b[n//2-1],b[n//2]
for i in a:print(x if i>x else y)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split());k-=1
for i in range(a,b+1):
  if i<=a+k or b-k<=i:print(i)

Fixed submission:
a,b,k=map(int,input().split())
for i in range(k):
  if a+i<=b:print(a+i)
for i in range(k):
  if a+k<=b-k+1+i:print(b-k+1+i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split());n=[i for i in range(a,b+1)];k-=1
for i in n:
  if i<=a+k or b-k<=i:print(i)

Fixed submission:
a,b,k=map(int,input().split())
for i in range(k):
  if a+i<=b:print(a+i)
for i in range(k):
  if a+k<=b-k+1+i:print(b-k+1+i)
Buggy python submission (verdict: Runtime Error):
a,b,c=sorted(map(int,input().split()))
co=(b-a)//2
if (b-a)%2==1:counter+=1;c+=1
co+=c-b
print(co)

Fixed submission:
a,b,c=sorted(map(int,input().split()))
co=(b-a)//2
if (b-a)%2==1:co+=1;c+=1
co+=c-b
print(co)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
def turn(n):
  global a,b,c
  def t(n,a):
    if n==a:return 0
    elif n<a:return a-n
    else:return (a-n+1)//2
  return t(n,a)+t(n,b)+(t,c)
mi=turn(0)
for i in range(1,51):mi=min(turn(i),mi)
print(mi)

Fixed submission:
a,b,c=sorted(map(int,input().split()))
co=(b-a)//2
if (b-a)%2==1:co+=1;c+=1
co+=c-b
print(co)
Buggy python submission (verdict: Runtime Error):
if int(input())+int(input())<int(input()):print("No")
else:print("Yes")

Fixed submission:
a,b,c=map(int,input().split())
if a+b<c:print("No")
else:print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input());a=[int(input())for i in range(n)];m=int(input());b=[int(input())for i in range(m)];ans=0
for i in a:ans=max(a.count(i)-b.count(i),ans)
print(ans)

Fixed submission:
n=int(input());a=[input()for i in range(n)];m=int(input());b=[input()for i in range(m)];ans=0
for i in a:ans=max(a.count(i)-b.count(i),ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=input();print(a[0]+b[1]+c[2])

Fixed submission:
a,b,c=input(),input(),input();print(a[0]+b[1]+c[2])
Buggy python submission (verdict: Runtime Error):
def sortex(X):
  b=sorted(X)
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
n,s=int(input()),input().split();s=sortex(s);print("Four"if len(n)==4else"Three")

Fixed submission:
def sortex(X):
  b=sorted(X)
  b.append("null")
  a=[]
  for i in range(len(X)):
    if b[i]!=b[i+1]:a.append(b[i])
  return a
n,s=int(input()),input().split();s=sortex(s);print("Four"if len(s)==4else"Three")
Buggy python submission (verdict: Runtime Error):
n=input()
if len(n)==1:print(n)
elif n="9"*len(n):print(9*len(n))
else:print(9*(len(n)-1)+int(n[0])-1)

Fixed submission:
n=input()
if len(n)==1:print(n)
elif n=="9"*len(n):print(9*len(n))
elif n[1:]=="9"*(len(n)-1):print(int(n[0])+9*(len(n)-1))
else:print(9*(len(n)-1)+int(n[0])-1)
Buggy python submission (verdict: Time Limit Exceeded):
def printt(x):
  print(x,flush=True)
  i=input()
  if i=="Vacant":exit()
  if i=="Male":return 0
  return 1
n=int(input())
ng=0
ok=n
f=printt(0)
while ng+1!=ok:
  mid=(ok+ng)//2
  if (printt(mid)==f)==((ng+mid)%2==0):ng=mid
  else:ok=mid

Fixed submission:
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if (mid+f)%2==out(mid)%2:ng=mid
  else:ok=mid

Buggy python submission (verdict: Time Limit Exceeded):
def printt(x):
  print(x,flush=True)
  i=input()
  if i=="Vacant":exit()
  if i=="Male":return 0
  return 1
n=int(input())
ng=0
ok=n
f=printt(0)
while ng+1!=ok:
  mid=(ok+ng)//2
  if printt(mid)==f and (ng+mid)%2==0:ng=mid
  else:ok=mid

Fixed submission:
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if (mid+f)%2==out(mid)%2:ng=mid
  else:ok=mid

Buggy python submission (verdict: Time Limit Exceeded):
def printt(x):
  print(x,flush=True)
  i=input()
  if i=="Vacant":exit()
  if i=="Male":return 0
  return 1
n=int(input())
ng=0
ok=n
f=printt(0)
while ng+1!=ok:
  mid=(ok+ng)//2
  if (printt(mid)==f)^((ng+mid)%2==0):ok=mid
  else:ng=mid

Fixed submission:
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if (mid+f)%2==out(mid)%2:ng=mid
  else:ok=mid

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if mid%2==out(mid)%2+f:ng=mid
  else:ok=mid

Fixed submission:
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if (mid+f)%2==out(mid)%2:ng=mid
  else:ok=mid

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
ng=-1
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  m=out(mid)
  if mid%2==m%2:ng=mid
  else:ok=mid

Fixed submission:
n=int(input())
def out(i):
  print(i,flush=True)
  s=input()
  if s=="Male":return 0
  elif s=="Female":return 1
  else:exit()
f=out(0)
ng=0
ok=n
while ng+1!=ok:
  mid=(ng+ok)//2
  if (mid+f)%2==out(mid)%2:ng=mid
  else:ok=mid
Buggy python submission (verdict: Runtime Error):
s=input();s[3]="8"
print(s)

Fixed submission:
s=input();print(s[:3]+"8"+s[4:])