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

Fixed submission:
c = input()
boin = 'aeiou'
if c in boin:
    print('vowel')
else:
    print('consonant')

Buggy submission (verdict: Runtime Error):
class UnionFind:
    MAX_N = 0
    PAR  = [] 
    RANK = []

    def __init__(self,n):
        self.MAX_N = n
        self.PAR = [ i for i in range(n)]
        self.RANK= [ 0 ] * n

    def find(self,x):
        if self.PAR[x] == x:
            return x
        else:
            self.PAR[x] = self.find(self.PAR[x])
            return self.PAR[x] 

    def union(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.RANK[x] < self.RANK[y]:
            self.PAR[x] = y
        else:
            self.PAR[y] = x
            if self.RANK[x] == self.RANK[y]:
                self.RANK[x] += 1

    def same(self,x,y):
        return self.find(x) == self.find(y)

N,K,L = map(int,input().split())
path = UnionFind(N+1)
for _ in range(K):
    p,q = map(int,input().split())
    path.union(p,q)
rail = UnionFind(N+1)
for _ in range(L):
    p,q = map(int,input().split())
    rail.union(p,q)

Data = {}
for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    if k in Data.keys():
        Data[k] += 1
    else:
        Data[k] = 1

for i in range(1,N+1):
    p = path.find(i)
    r = rail.find(i)
    k = str(p)+"-"+str(r)
    print( Data[k], end= ' ')
Problem p02642 (python)

Fixed submission:
# Not Divisible

N = int(input())
A = [int(n) for n in input().split()]

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy submission (verdict: Runtime Error):
# Not Divisible

N = int(input())
A = [int(n) for n in input().split()]

check = [0] * 1000000
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000000, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy submission (verdict: Runtime Error):
# Not Divisible

N = int(input())
A = [int(n) for n in input().split()]

check = [0] * 1000000
A.sort()

ok = []
p = -1
for a in A:
    if a == p:
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000000, a):
        check[i] = 1
    ok.append(a)

print(len(ok))
Problem p02612 (python)

Fixed submission:
import math
N = int(input())
print(math.ceil(N/1000)*1000 - N)

Buggy submission (verdict: Runtime Error):

iAC = 0
iWA = 0
iTLE = 0
iRE = 0

N = int(input())
for i in range(N):
    S = input()
    if S == "AC":
        iAC += 1
    elif S == "WA":
        iWA += 1
    elif S == "TLE":
        iTLE += 1
    elif S == "RE":
        iRE += 1

print("AC x {}".format(iAC))
print("WA x {}".format(iWA))
print("TLE x {}".format(iTLE))
print("RE x {}".format(iRE))
Problem p02681 (python)

Fixed submission:
s=input()
t=input()
if(t[0:-1]==s):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s,t=input().split()
if(t[0:-1]==s):
  print("Yes")
else:
  print("No")
Problem p02639 (python)

Fixed submission:
array = list(map(int, input().split()))
print(array.index(0)+1)

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print("{} {} {}".format(c,a,b))
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(Max(a-2*b,0))
Problem p02993 (python)

Fixed submission:
l=input()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Buggy submission (verdict: Runtime Error):
l=input()
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Buggy submission (verdict: Runtime Error):
l=list(input())
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')

Buggy submission (verdict: Runtime Error):
for i in range(len(l)):
    if l[i]==l[i+1]:
        print('Bad')
        break
else:
    print('Good')
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2))
else:
    print(b)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a<=5:
    print(0)
elif 6<=a and a<=12:
    print(int(b/2)a)
else:
    print(b)
Problem p03145 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(a*b*/2)
Problem p03292 (python)

Fixed submission:
a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
a,b,c = map(int,input().split())
l=sorted([a,b,c])
print(l[2]-l[1]+l[1]-l[0])
Problem p03385 (python)

Fixed submission:
s = input()
print('Yes' if s[0]!=s[1] and s[1]!=s[2] and s[0]!=s[2] else 'No')

Buggy submission (verdict: Runtime Error):
s = input()
print('Yes' if s[0]!=s[1]&&s[1]!=s[2]&&s[0]!=s[2] else 'No')
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print('Odd' if a%2!=0 and b%2!=0 else 'Even')

Buggy submission (verdict: Runtime Error):
print('Odd' if int(input())%2!=0 and int(input())%2!=0 else 'Even')

Buggy submission (verdict: Runtime Error):
print('Odd' if input()%2!=0 and input()%2!=0 else 'Even')
Problem p03485 (python)

Fixed submission:
a,b = map(int,input().split())
import math
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import math
print(math.ceil((int(input())+int(input()))/2))

Buggy submission (verdict: Runtime Error):
import math
print(math.ceil((int(input)+int(input))/2))
Problem p03635 (python)

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

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print(n*m-2(n+m)+4)
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
if a+b>=24:
  print(a+b-24)
else:
  print(a+b)

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

Fixed submission:
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y:
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
x= (a=="H")
y=(b=="H")
if x and y or not x and not y
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b=input().split()
x= (a=="H")
y=(b=="H")
if :x and y or not x and not y
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
x= (a=="H")
y=(b=="H")
if :x and y or not x and not y
  print("H")
else:
  print("D")
Problem p03860 (python)

Fixed submission:
xs = input().split()
 
print("A"+xs[1][0]+"C")

Buggy submission (verdict: Runtime Error):
xs = inpt().split()

print("A"+xs[2][0]+"B")
Problem p03943 (python)

Fixed submission:
ys = list(map(int,input().split()))
ys.sort()
print('Yes' if ys[0]+ys[1]==ys[2] else 'No')

Buggy submission (verdict: Runtime Error):
ys = list(map(int,input().split()))
ys.sort()
print('Yes' if ys[0]+ys[1]==y[2] else 'No')
Problem p02705 (python)

Fixed submission:
r=int(input())
print(2*r*3.141592)

Buggy submission (verdict: Runtime Error):
import math
print((int(input())*2*math.pi())

Buggy submission (verdict: Runtime Error):
r=int(input())
import math
print(math.pi()*r**2)
Problem p02706 (python)

Fixed submission:
n,m=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]
rem = n-sum(a)
print(rem if rem>=0 else -1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
for num	in input().split():
  n-=num
print(n if n>=0 else -1)
Problem p02741 (python)

Fixed submission:
k=int(input())
nums=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[k-1])

Buggy submission (verdict: Runtime Error):
k=int(input())
nums=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[k])
Problem p02767 (python)

Fixed submission:
n=int(input())
X=list(map(int,input().split()))
ans=float('inf')
for i in range(min(X),max(X)+1):
  now=0
  for x in X:
    now+=(i-x)*(i-x)
  ans=min(now,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
X=list(map(int,input().split()))
ans=float('inf')
for i in range(min(x),max(x)):
  now=0
  for x in X:
    now+=(i-x)*(i-x)
  ans=min(now,ans)
print(ans)
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
def expe(n):
  return (n+1)/2
p=[expe(int(x)) for x in input().split()]
l,r=[p[0]]*(n+1),[p[n-1]]*(n+1)
for i in range(n-1):
  l[i+1]=l[i]+p[i+1]
  r[n-2-i]=r[n-1-i]+p[n-2-i]
r[n],l[n]=0,sum(p)
su=sum(p)
ans=max(su-r[k],su-l[n-k-1])
for i in range(1,n-k-1):
  sumk=su-l[i-1]-r[i+k]
  ans=max(sumk,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
def expe(n):
  return (n+1)/2
p=[expe(int(x)) for x in input().split()]
l,r=[p[0]]*n,[p[n-1]]*n
for i in range(n-1):
  l[i+1]=l[i]+p[i+1]
  r[n-2-i]=r[n-1-i]+p[n-2-i]
su=sum(p)
ans=max(su-r[k],su-l[n-k-1])
for i in range(1,n-k-1):
  sumk=su-l[i-1]-r[i+k]
  ans=max(sumk,ans)
print(ans)
Problem p02842 (python)

Fixed submission:
n=int(input())
f=False
for i in range(1,5*10**4+1):
  if n==i*1.08//1:
    f=True
    break
if f:
  print(i)
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
n=int(input())
f=False
for i in range(1,5*10**4+1):
  if n==i*1.08//1
  	f=True
    
if f:
  print(i)
else:
  print(":(")
Problem p02865 (python)

Fixed submission:
n=int(input())
if n%2==1:
  print((n-1)//2)
else:
  print(n//2-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=max(a)
count=[0]*(m+1)
for i in a:
    count[i] += 1
if a[0]:
    print(0)
    exit()
for i in range(m):
    if count[i]==0 and count[i+1]:
        print(0)
        exit()

ans=1

for i in range(len(count)-1):
    ans*=count[i]**count[i+1]
    ans%=998244353
print(ans)
Problem p02882 (python)

Fixed submission:
a,b,x=map(int,input().split())
import math
 
if x == a**2*b/2:
  print(float(90)-math.degrees(math.atan(a/b)))
elif x == a*a*b:
  print(0)
elif x < a**2*b/2:
  print(float(90)-math.degrees(math.atan(2*x/a/b/b)))
else:
  print(float(90)-math.degrees(math.atan((a*a*b-x)**(-1)*a**3/2)))

Buggy submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
import math
 
if x == a**2*b/2:
  print(float(90)-math.degrees(math.atan(a/b)))
elif x < a**2*b/2:
  print(float(90)-math.degrees(math.atan(2*x/a/b/b)))
else:
  print(float(90)-math.degrees(math.atan((a*a*b-x)**(-1)*a**3/2)))

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

if x == a**2*b/2:
  print(math.degrees(math.atan(a/b)))
elif x < a**2*b/2:
  print(math.degrees(math.atan(2*x/a/b/b)))
else:
  print(math.degrees(math.atan((a*a*b-x)**(-1)*a**3/2)))

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

if x == a**2*b/2:
  print(math.atan(a/b))
elif x < a**2*b/2:
  print(math.atan(2*x/a/b/b))
else:
  print(math.atan((a*a*b-x)**(-1)*a**3/2))

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

if x == a**2*b/2:
  print(math.atan(a/b))
elif x < a**2*b/2:
  print(math.atan(2*x/a/b/b))
else:
  print(math.atan((a*a*b-x)**(-1)*a**3/2)
Problem p02898 (python)

Fixed submission:
NK = input().split()
K=int(NK[1])
h=list(map(int,input().split()))

count = 0
for hi in h:
  if hi >= K:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
n=list(int(input().splice()))
n[1]=K
h=list(int(input().splice()))

count = 0
for hi in h:
  if hi >= K:
    count += 1

print(count)
Problem p02900 (python)

Fixed submission:
import math
def prime(n):
    flag = True
    if n==1 or n==2:
        return True
    for i in range(2,math.ceil(math.sqrt(n))+1):
        if n%i == 0:
            flag = False
            break
    return flag

a,b=map(int,input().split())
A=set()
B=set()

for i in range(1,math.ceil(math.sqrt(a))+1):
    if a%i == 0:
        A.add(i)
        A.add(a//i)

for i in range(1,math.ceil(math.sqrt(b))+1):
    if b%i == 0:
        B.add(i)
        B.add(b//i)

A=[num for num in A if prime(num)]
B=[num for num in B if prime(num)]

ans=0
for b in B:
    if b in A:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
AB = input().split()
A,B = int(AB[0]),int(AB[1])

count=0
def is_prime(n):
  flag=True
  while i;i<=sqrt(n);i+=1:
	if n%i != 0:
      flag = False
      break
      
for i in range(min(A,B)):
  if is_prime(i)
	if A%i==0 and B%i==0:
      count+=1
      
print(count)
Problem p02910 (python)

Fixed submission:
s=input()
flag=True
for i in range(len(s)):
  if i%2==1 and s[i]=="R":
    flag=False
    break
  elif i%2==0 and s[i]=="L":
    flag = False
    break
if flag:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S=input()
flag = True
 
for i in range(len(S)):
  if i%2==0 and S[i] == R:
    print('No')
    flag = False
    break
  elif i%2==1 and S[i] == L:
    print('No')
    flag = False
    break
if flag:
  print('Yes')

Buggy submission (verdict: Runtime Error):
S=input()
flag = True

for i in range(len(a)):
  if i%2==0 and S[i] == R:
    print('No')
    flag = False
    break
  elif i%2==1 and S[i] == L:
    print('No')
    flag = False
    break
if flag:
  print('Yes')
Problem p02917 (python)

Fixed submission:
N = int(input())
B=list(map(int,input().split()))
A=[0]*N

for i in range(N):
  if i==0:
    A[i] = B[i]
  elif i==N-1:
    A[i] = B[i-1]
  else:
  	A[i] = min(B[i],B[i-1]) 

print(sum(A))

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

Buggy submission (verdict: Runtime Error):
n=int(input())
b=list(map(int,input().split()))
a[0]*n
for i in range(i):
  if i<=n-2:
    a[i] = min(b[i],b[i+1])
  else:
    a[i] = b[i-1]
print(sum(a))
Problem p02923 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[]

suc=0
for i in range(n-1):
  if a[i] >= a[i+1]:
    suc += 1
  else:
    b.append(suc)
    suc=0
b.append(suc)
print(max(b))

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

suc=0
for i in range(n-1):
  if a[i] >= a[i+1]:
    suc += 1
  else:
    b.append(suc)
    suc=0
if i==n-2:
    b.append(suc)
print(max(b))
Problem p02946 (python)

Fixed submission:
KX=input().split()
K,X=int(KX[0]),int(KX[1])
 
lis = list(range(X-K+1,X+K))
print(*lis)

Buggy submission (verdict: Runtime Error):
KX=input().split()
K,X=int(KX[0]),int(KX[1])

lis = list(range(X-K+1,X+K)
print(*lis)
Problem p02971 (python)

Fixed submission:
N=int(input())
A=[]
for _ in range(N):
  A.append(int(input()))

value=max(A)
index = A.index(max(A))
for i in range(N):
  if i==index:
    b=A.pop(i)
    print(max(A))
  else:
      print(value)

Buggy submission (verdict: Runtime Error):
n=int(input())
for _ in range(n):
  a.append(int(input()))
l=[l[0]]*n
for i in range(1,n):
  l[i] = max(a[i],l[i-1])
a.reverse()
r=[r[0]]*n
for i in range(1,n):
  r[i] = max(a[i],r[i-1])
for i in range(n):
  print(max(l[i-1],r[n-i-1]))
Problem p02988 (python)

Fixed submission:
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  maxi = max(p[i-1],p[i],p[i+1])
  mini = min(p[i-1],p[i],p[i+1])
  if p[i] != maxi and p[i] != mini:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  max = max(p[i-1],p[i],p[i+1])
  min = min(p[i-1],p[i],p[i+1])
  if p[i] != max and p[i] != min:
    ans += 1
print(ans)
Problem p03086 (python)

Fixed submission:
s=input()
def c(b):
  return b=='A' or b=='G' or b=='T' or b=='C'

suc=[]
ct=0
for let in s:
  if c(let):
    ct+=1
  else:
    suc.append(ct)
    ct=0
suc.append(ct)
print(max(suc))

Buggy submission (verdict: Runtime Error):
s=input()
def c(b):
  return b=='A' or b=='G' or b=='T' or b=='C'

suc=[]
ct=0
for let in s:
  if c(let):
    ct+=1
  else:
    suc.append(ct)
    suc=0
suc.append(ct)
print(max(suc))
Problem p03105 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(min(a//b,c)
Problem p03316 (python)

Fixed submission:
def s(n):
    rtn=0
    while n>0:
        rtn += n%10
        n//=10
    return rtn
x=int(input())
print('Yes' if x%s(x)==0 else 'No')

Buggy submission (verdict: Runtime Error):
def s(n):
	rtn=0
    while n>0:
    	rtn+=n%10
        n//10
    return rtn
n=int(input())
print("Yes" if n%s(n)==0 else "No")
Problem p03324 (python)

Fixed submission:
d,n=map(int,input().split())
print(100**d*n if n!=100 else 100**(d+1)+100**d)

Buggy submission (verdict: Runtime Error):
d,n=int(int,input().split())
print(100**d*n)
Problem p02613 (python)

Fixed submission:
n_entradas = int(input())
contador = 0
vetor=[]
while (contador<n_entradas):
    situacao = str(input())
    vetor.append(situacao)
    contador=contador+1    
print('AC x',vetor.count('AC'))
print('WA x',vetor.count('WA'))
print('TLE x',vetor.count('TLE'))
print('RE x',vetor.count('RE'))

Buggy submission (verdict: Runtime Error):
import pandas as pd
n_entradas = int(input())
contador = 0
vetor=[]
while (contador<n_entradas):
    situacao = str(input())
    vetor.append(situacao)
    contador=contador+1    
print('AC x',vetor.count('AC'))
print('WA x',vetor.count('WA'))
print('TLE x',vetor.count('TLE'))
print('RE x',vetor.count('RE'))
Problem p02573 (python)

Fixed submission:
from collections import deque
n,m=map(int,input().split())
ans=0


group = [set() for _ in range(n)]

for i in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    group[a].add(b)
    group[b].add(a)


kisyutu = set()
deque = deque()

for i in range(n):
    if i not in kisyutu:
        kisyutu.add(i)
        friend_set=group[i]

        deque.extend(group[i])

        while deque:
            a1 = deque.pop()
            if a1 not in kisyutu:
                kisyutu.add(a1)
                friend_set.add(a1)
                deque.extend(group[a1])
        ans = max(ans, len(friend_set)+1)

if m!=0:
    print(ans)
else:
    print(1)

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

group = [0]*n
group_num = 1

for i in range(m):
    a,b=map(int,input().split())
    a-=1
    b-=1
    a1 = group[a]  
    b1 = group[b]
    if a1 == 0 and b1 == 0:
        group[a] = group_num
        group[b] = group_num
        group_num += 1
    elif a1 != 0:
        group[b] = a1
    else:
        group[a] = b1

group.sort()
group_num1 = 1
cnt = 1

if m != 0:
    for i in range(group.index(1)+1,n):
        if group[i] == group[i-1]:
            cnt += 1
        else:
            ans = max(ans,cnt)
            cnt = 1
    ans = max(ans,cnt)
    print(ans)
else:
    print(1)
Problem p02742 (python)

Fixed submission:
h,w=map(int,input().split())
if h==1 or w==1:
    print(1)
else:
    print(-(-(h*w)//2))

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
mas=[[0]*w for _ in range(h)]
cnt=0
for i in range(h):
    if i%2==0:
        for j in range(w)[::2]:
            cnt += 1
    else:
        for j in range(1,w)[::2]:
            cnt += 1
print(cnt)
Problem p02952 (python)

Fixed submission:
n=input()
L=[9,0,900,0,90000]
ans=0
if len(n)==1:ans=int(n)
else:
    for i in range(len(n)-1):
        ans+=L[i]
    if len(n)%2!=0:ans+=int(n)-int("9"*max(0,len(n)-1))
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
L=[9,0,900,0,90000]
ans=0
for i in range(len(n)-1):
    ans+=L[i]
if len(n)%2!=0:ans+=int(n)-int("9"*(len(n)-1))
print(ans)
Problem p02957 (python)

Fixed submission:
a,b=map(int,input().split());print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().splut());print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE)
"
Problem p02995 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

a,b,c,d = map(int,input().split())

c_m = b//c - (-(-a//c)) +1
d_m = b//d  - (-(-a//d)) + 1
cd = lcm(c,d)
cd_m = b//(cd) - (-(-a//(cd))) + 1

print(b-a+1 -(c_m + (d_m -cd_m)*(d%c != 0)))

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())

c_m = b//c - (-(-a//c)) +1
d_m = b//d  - (-(-a//d)) + 1
cd = c*d//math.gcd(c,d)
cd_m = b//(cd) - (-(-a//(cd))) + 1

print(b-a+1 -(c_m + (d_m -cd_m)*(d%c != 0)))
Problem p02999 (python)

Fixed submission:
print(0 if eval(input().replace(" ","-"))<0 else 10)

Buggy submission (verdict: Runtime Error):
print(0 if eval(input().replace(" ","/"))<1 else 10)
Problem p03087 (python)

Fixed submission:
n,q = map(int,input().split())
s = input().replace("AC","aC")
L = [0]*n
cnt = 0
for i in range(1,n):
    if s[i-1] == "a":
        cnt += 1
    L[i]=cnt
        
for i in range(q):
    l,r = map(int,input().split())
    print(L[r-1] - L[l-1])

Buggy submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
for i in range(n):
    l,r = map(int,input().split())
    print(s[l-1:r].count("AC"))
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
m_root=int(m**0.5)
div_l=[]
ans=0

for i in range(1,m_root + 1):
    if m%i == 0:
        div_l.append(i)
        div_l.append(m//i)

if m//n in div_l:
    ans = m//n
else:
    div_l.append(m//n)
    div_l.sort()
    ans = div_l[div_l.index(m//n) - 1]
print(ans)
Problem p03274 (python)

Fixed submission:
n,k=map(int,input().split())
x=list(map(int,input().split()))
x.append(0)
x.sort()
x_0=x.index(0)

if x_0 == 0:
    print(x[k])
elif x_0==n:
    print(-x[-k-1])
else:
    r = min(n-x_0, k)
    l = min(x_0, k)
    ans1=float("inf")
    ans2=float("inf")
    #スタートで正に移動
    for i in range(1,r+1):
        if  k-i <= l:
            s = 2*x[x_0 + i] - x[x_0 - (k-i)]
            ans1=min(ans1, s)
    #スタートで負に移動
    for i in range(1,l+1):
        if k-i <= r:
            s = -2*x[x_0 - i] + x[x_0 + (k-i)]
            ans2=min(ans2, s)
    print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
x=list(map(int,input().split()))
x.append(0)
x.sort()
x_0=x.index(0)

if x_0 == 0:
    print(x[k])
elif x_0==n:
    print(-x[-k-1])
else:
    r = min(n-x_0-1, k)
    l = min(x_0, k)
    ans1=float("inf")
    ans2=float("inf")
    #スタートで正に移動
    for i in range(1,r):
        s = 2*x[x_0 + i] - x[x_0 - (k-i)]
        ans1=min(ans1, s)
    for i in range(1,l):
        s = -2*x[x_0 - i] + x[x_0 + (k-i)]
        ans2=min(ans2, s)
    print(min(ans1, ans2))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
x=list(map(int,input().split()))
x.append(0)
x.sort()
x_0=x.index(0)

if x_0 == 0:
    print(x[k])
elif x_0==n:
    print(x[-k])
else:
    r = min(n-x_0-1, k)
    l = min(x_0, k)
    ans1=float("inf")
    ans2=float("inf")
    #スタートで正に移動
    for i in range(1,r):
        s = 2*x[x_0 + i] - x[x_0 - (k-i)]
        ans1=min(ans1, s)
    for i in range(1,l):
        s = -2*x[x_0 - i] + x[x_0 + (k-i)]
        ans2=min(ans2, s)
    print(min(ans1, ans2))
Problem p03282 (python)

Fixed submission:
s=list(input())
k=int(input())

if s[:k].count("1") ==k:print(1)
else:
    for i in range(k):
        if s[i]!="1":
            print(s[i])
            break

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
print(int(s[1]) if s[0]=="1" else s[0])