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

Fixed submission:
def factorial_mod(a, M):
    # return a!(mod M)
    ans = 1
    for i in range(a,1,-1):
        ans = (ans * i) % M
    return ans
def test(n, a, M):
    # return (nCaの分子) % M
    ans = 1
    for i in range(a):
        ans = (ans * (n-i)) % M
    return ans
def combination_mod(n,a,M):
    # return nCa % M
    tmp = factorial_mod(a,M)
    tmp = pow(tmp, M-2, M)
    ans = test(n,a,M) * tmp % M
    return ans
def output(n,a,b):
    M = 10**9+7
    ans = (pow(2,n,M) - 1 - combination_mod(n,a,M) - combination_mod(n,b,M)) % M
    return ans
n, a, b = map(int, input().split())
print(output(n,a,b))

Buggy submission (verdict: Runtime Error):
def factorial_mod(a, M):
    ans = 1
    for i in range(a,1,-1):
        ans = (ans * i) % M
    return ans
def test(n, a, M):
    ans = 1
    for i in range(a):
        ans = (ans * (n-i)) % M
    return ans
def combination_mod(n,a,M):
    tmp = factorial_mod(a,M)
    tmp = pow(tmp, M-2, M)
    ans = test(n,a,M) * tmp % M
    return ans
def output(n,a,b):
    M = 10**9+7
    ans = (pow(2,n,M) - 1 - combination_mod(n,a,M) - combination_mod(n,b,M)) % M
    return ans
n, a, b = map(int, input().split())
print(output(a,b,c))
Problem p02854 (python)

Fixed submission:
N = int(input())
list = [int(i) for i in input().split()]

forward = 0
backward = N-1

sum = list[forward]
sum2 = list[backward]
while (True):
    if backward - forward == 1:
        break
    if sum < sum2:
        forward += 1
        sum += list[forward]
    else:
        backward -= 1
        sum2 += list[backward]
print(abs(sum - sum2))

Buggy submission (verdict: Runtime Error):
N = int(input())
list = [int(i) for i in input().split()]

forward = 0
backward = N-1

sum = list[forward]
sum2 = list[backward]
while (True):
    if sum < sum2:
        forward += 1
        sum += list[forward]
    else:
        backward -= 1
        sum2 += list[backward]
    if backward - forward == 1:
        break
print(abs(sum - sum2))
Problem p02584 (python)

Fixed submission:
from math import floor
import decimal
x,k,d=map(int,input().split())
if x==0:
	if k%2==0:
		print(0)
	else:
		print(d)
	exit(0)	
with decimal.localcontext() as ctx:
    ctx.prec = 150
    t=floor(decimal.Decimal(abs(x))/decimal.Decimal(d))
    

if (k<=t):
	if (x>0):
		print(abs(x-k*d))
	else:
		print(abs(x+k*d))
else:
	if (x>0):
		x=x-t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x-d))
	else:
		x=x+t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x+d))

Buggy submission (verdict: Runtime Error):
x,k,d=map(int,input().split())
if x==0:
	if k%2==0:
		print(0)
	else:
		print(d)
    exit(0)
t=abs(x//d)
if (k<=t):
	if (x>0):
		print(x-k*d)
	else:
		print(x+k*d)
	exit(0)
else:
	if (x>0):
		x=x-t*d
		k-=t
		if k%2==0:
			print(x)
		else:
			print(abs(x-d))
	else:
		x=x+t*d
		k-=t
		if k%2==0:
			print(abs(x))
		else:
			print(abs(x+d))
Problem p03076 (python)

Fixed submission:
import math

arr = [int(input()) for _ in range(5)]

br = 0
last = 0
for r in range(1, 10):
    for i in range(5):
        if((arr[i] % 10) == r):
            last = i
            br = 1
            break
        pass
    if(br == 1):
        break
    pass

time = 0
for i in range(5):
    time += math.ceil(arr[i]/10) * 10

time += arr[last] - math.ceil(arr[last]/10) * 10

print(time)

Buggy submission (verdict: Runtime Error):
import math

arr = [int(input()) for _ in range(5)]

br = 0
for r in range(1, 10):
    for i in range(5):
        if((arr[i] % 10) == r):
            last = i
            br = 1
            break
        pass
    if(br == 1):
        break
    pass

time = 0
for i in range(5):
    time += math.ceil(arr[i]/10) * 10

time += arr[last] - math.ceil(arr[last]/10) * 10

print(time)
Problem p03079 (python)

Fixed submission:
a = input().split()
if int(a[0]) == int(a[1]) and int(a[1]) == int(a[2]):
	print("Yes")
else:
	print("No")

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

if a==b==c
	print("Yes")
else
	print("No")

Buggy submission (verdict: Runtime Error):

l = map(int, input().split())

if l[0] == l[1] == l[2]
	print("Yes")
else
	print("No")

Buggy submission (verdict: Runtime Error):
l = input().split()

if l[0] == l[1] and l[1] == l[2]
	print("Yes")
else
	print("No")
Problem p03035 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6 and a <= 12:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
 
if a >= 13:
  print(b)
elif a >= 6:
  print((int)b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a, b = map(int(input().split()))
 
if a >= 13:
  print(b)
elif a >= 6:
  print((int)b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
ab = input().split();

a = ab[0]
b = ab[1]
 
if a >= 13:
  print(b)
elif a >= 6:
  print((int)b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6:
  print((int)b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6:
  print(b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6 and a <= 12:
  print(int(b/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6 and a <= 12:
  print(b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
 
if a >= 13:
  print(b)
elif a >= 6 && a <= 12:
  print(b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = (int)input()
b = (int)input()

if a >= 13:
  print(b)
elif a >= 6 && a <= 12:
  print(b/2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a = (int)input();
b = (int)input();
if a >= 13:
  print(b)
elif a >= 6 && a <= 12:
  print(b/2)
else:
  print(0)
Problem p02582 (python)

Fixed submission:
s = input()

if "RRR" in s:
  print(3)
elif "RR" in s:
  print(2)
elif "R" in s:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
s = input()

if s == "SSS":
  print(0)
elif s == "SSR":
  print(1)
elif s == "SRS":
  print(1)
elif s == "SRR":
  prin(2)
elif s == "RSS":
  print(1)
elif s == "RSR":
  print(1)
elif s == "RRS":
  print(2)
elif s == "RRR":
  print(3)
Problem p02658 (python)

Fixed submission:
n = int(input())
d = list(map(int, input().split()))
c_nega = 0
flag = False
for i in range(n):
  if d[i] == 0:
    flag = True
    break

if flag:
  print(0)
else:
  a = 1
  for i in range(n):
    a *= d[i]
    if a > 10**18:
      flag = True
      break
  if flag:
    print(-1)
  else:
    print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = 1
flag = False
for _ in range(n):
  d = int(input())
  a *= d
  if a > 10**18:
    flag = True
    break
if flag:
  print(-1)
else:
  print(a)
Problem p02696 (python)

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

if b < n:
  x = b-1
elif b == n:
  x = b-1
else:
  x = n

print(int(a*x/b) - a*int(x/b))

Buggy submission (verdict: Runtime Error):
(defun calc (x a b n)
  (- (floor (/ (* a x) b))
     (* a (floor (/ x b)))))

(let ((a (read))
      (b (read))
      (n (read)))
     (format t "~A" (if (<= b n)
                        (calc (1- b) a b n)
                        (calc n a b n))))
Problem p03241 (python)

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

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

if n % m == 0:
  print(int(n/m))
  exit()
else:
  lst = make_divisors(m)[::-1]
  for i in lst:
    if i == 1:
      print(i)
      exit()
    if m - i*(n-1) > 0:
      if (m - i*(n-1)) % i == 0:
        print(i)
        exit()
    else:
      continue

Buggy submission (verdict: Runtime Error):
import sympy

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

if n % m == 0:
  print(int(n/m))
  exit()
else:
  lst = sympy.divisors(m)[::-1]
  for i in lst:
    if i == 1:
      print(i)
      exit()
    if m - i*(n-1) > 0:
      if (m - i*(n-1)) % i == 0:
        print(i)
        exit()
    else:
      continue
Problem p02645 (python)

Fixed submission:
s = input()
print(s[0:3])

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

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:
    print("NO")
Problem p02646 (python)

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

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:
    print("NO")

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

dis = abs(a-b)
sub = w-v

if(-(sub*t)>=dis):
    print("YES")
else:
Problem p02639 (python)

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

Buggy submission (verdict: Runtime Error):
x=list(map(int,input().split()))
for i in range(n):
    if x[i]==0:
        print(i+1)
        break
Problem p02690 (python)

Fixed submission:
x=int(input())
for i in range(10**3):
    for j in range(2*10**3):
        if (i)**5-(j-10**3)**5==x:
            print(i,j-10**3)
            exit()

Buggy submission (verdict: Runtime Error):
a = int( x**(1/5) )
b = int( x**(1/5) )
p = a**5-x
q = b**5-x
while abs(p**(1/5)).is_integer()!=True and abs(q**(1/5)).is_integer()!=True:
        a-=1
        b+=1
else:
    if abs(p**(1/5)).is_integer()==True:
        if p>=0:
            print(a,int(p**(1/5)))
        else:
            print(a,int(abs(p**(1/5)))*(-1))
    else:
        if q>=0:
            print(b,int(q**(1/5)))
        else:
            print(b,int(abs(q**(1/5)))*(-1))
Problem p02778 (python)

Fixed submission:
s=input()
n=int(len(s))
print("x"*n)

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
for i in range(n):
  s[i]=x
print(s)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

Buggy submission (verdict: Runtime Error):
h,a=map(input(int()))
if h%a==0:
  print(h//a)
else:
  print(h//a+1)

Buggy submission (verdict: Runtime Error):
h,a=map(int(input()))
if h%a==0:
  print(h//a)
else:
  print(h//a+1)
Problem p02786 (python)

Fixed submission:
import math
h=int(input())
i=int(math.log(h,2))
print((2**(i+1))-1)

Buggy submission (verdict: Runtime Error):
import.math
h=int(input())
i=int(math.log(2,h))
print(2**(i+1)-1)
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n=m:
  print("Yes")
else:
  print("No")
Problem p02801 (python)

Fixed submission:
c=input()
a=[chr(i) for i in range(97, 97+26)]
print(a[a.index(c)+1])

Buggy submission (verdict: Runtime Error):
c=input()
print (chr(ord(c) + 1)

Buggy submission (verdict: Runtime Error):
c=input()
print chr(ord(c) + 1)
Problem p02812 (python)

Fixed submission:
n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=list(input())
cnt=0
for i in range(n-2):
  if s[i]="A" and s[i+1]="B" and s[i+2]="C":
    cnt += 1
print(cnt)
Problem p02830 (python)

Fixed submission:
n=int(input())
s,t=input().split(" ")
u=""
for i in range(n):
  u = u + s[i] + t[i]
print(u)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=input().split("")
P=""
for i in range(N):
  P=P+S[i]+T[i]
print(P)
Problem p02865 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
if n%2==0:
  print((n/2)-1)
else:
  print((n-1)/2)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print((n/2)-1)
else:
  print((n-1)/2)
Problem p02886 (python)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
s=0
for i in range(0,n-1):
  for j in range(i+1,n):
    s+=arr[i]*arr[j]
print(s)

Buggy submission (verdict: Runtime Error):
n=input()
arr=list(map(int,input().split()))
s=0
for i in range(0,n-1):
  for j in range(i+1,n):
    s+=arr[i]*arr[j]
print(s)
Problem p02887 (python)

Fixed submission:
n=int(input())
s=input()
x=0
for i in range(0,n-1):
  if s[i]==s[i+1]:
    x+=1
print(n-x)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
x=0
for i in range(0,n-1):
  if s[i]=s[i+1]:
    x+=1
print(n-x)

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

Fixed submission:
s=input()
if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s=input()
if s="Sunny":
  print("Cloudy")
if s="Cloudy":
  print("Rainy")
if s="Rainy":
  print("Sunny")
Problem p02910 (python)

Fixed submission:
s=list(input())
l=len(s)
for i  in range(0,l):
  if i%2==0:
    if s[i]=="L":
      print("No")
      exit()
  elif i%2==1:
    if s[i]=="R":
      print("No")
      exit()
  else:
    pass
print("Yes")

Buggy submission (verdict: Runtime Error):
s=list(input())
l=len(s)
for i  in range(0,l):
  if i%2==0:
    if s[i]=="R":
      print("No")
      exit()
  if i%2==1:
    if s[i]=="L":
      pirnt("No")
      exit()
print("Yes")
Problem p02917 (python)

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

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

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

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

Fixed submission:
s=list(input())
t=list(input())
x=0
for i in range(0,3):
  if s[i]==t[i]:
    x+=1
print(x)

Buggy submission (verdict: Runtime Error):
s=list(map(input().split()))
t=list(map(input().split()))
x=0
for i in range(0,2):
  if s[i]==t[i]:
    x+=1
print(x)

Buggy submission (verdict: Runtime Error):
s=list(map(input().split()))
t=list(map(input().split()))
x=0
for i in range(0,2):
  if s[i]=t[i]:
    x+=1
print(x)
Problem p02922 (python)

Fixed submission:
import math
a,b=map(int,input().split())
c=a-1
d=b-1
print(math.ceil(d/c))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(math.ceil((b-1)/(a-1)))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(math.ceil(b-1/a-1))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
x=0
for i:
  if (a-1)*i+1<b:
    x+=1
  else:
    exit()
print(x)
Problem p02958 (python)

Fixed submission:
n=int(input())
P=list(map(int,input().split()))
t=len(P)
m=0
for i in range(t):
  if P[i]!=i+1:
    m+=1
if m<=2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
p=list(map(int,input().split()))
cnt=0
for i in range(n):
  if p[i]=i+1:
    cnt += 1
if cnt < n-2:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
P=list(map(int,input().split()))
t=len(P)
m=0
for i in range(t):
  if P[i]!=P.index(i+1)+1:
    m+=1
if m=2:
  print("YES")
else:
  print("NO")
Problem p02969 (python)

Fixed submission:
r=int(input())
print(3*r*r)

Buggy submission (verdict: Runtime Error):
a=input()
print(3*(a**2))
Problem p03167 (python)

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

grid=[]

m=10**9+7

for i in range(H):
    a= list(input())
    grid.append(a)

dp=[ [0]*(W+3) for _ in range(H+3)]

for i in reversed(range(H)):
    for j in reversed(range(W)):
        dp[i][j] = dp[i+1][j] + dp[i][j+1]
        dp[H-1][W-1]=1
        if grid[i][j]=="#":
            dp[i][j]=0
print(dp[0][0]%m)

Buggy submission (verdict: Runtime Error):
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f
m = 10**9+7
def nCr(n,r):
  if r*2>n:
      return nCr(n,n-r)
  else:
      a = b = 1
      for i in range(r):
          a = a * (n - i) % m
          b = b * (r - i) % m
      return (a * pow(b,m-2,m)) % m

H,W=map(int,input().split())

grid=[]

for i in range(H):
    a= list(input())
    grid.append(a)

wall=[]
for i in range(H):
    for j in range(W):
        if grid[i][j]=="#":
            wall.append([i,j])

ans = nCr((H+W-2),(H-1))

for i in range(len(wall)):
    x = wall[i][0] + wall[i][1]
    y = (H-wall[i][0]) + (W-wall[i][1])
    ans -= nCr(x-1,wall[i][0]-1) * nCr(y-1,(H-wall[i][0])-1)

print(ans)
Problem p03568 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 3**N
num = 1
for i in A:
    if i%2 == 0:
        num *= 2
print( ans-num )

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 3 ** N
num = 1

for i in range(N):
    A = int(input())
    num *= (2-(A%2))

print(ans-num)
Problem p02802 (python)

Fixed submission:
def main(n: int, m: int, p_s: list):
    bool_ac = [False for _ in range(n)]
    count_wa = [0 for _ in range(n)]
    ac, wa = 0, 0

    for p, s in p_s:
        p = int(p)

        if bool_ac[p - 1]:
            continue

        if s == "AC":
            bool_ac[p - 1] = True
            wa += count_wa[p - 1]
            ac += 1
        elif s == "WA":
            count_wa[p - 1] += 1

    print(ac, wa)


if __name__ == "__main__":
    n, m = map(int, input().split())
    p_s = [input().split() for _ in range(m)]

    main(n, m, p_s)

Buggy submission (verdict: Runtime Error):
def main(n, m, p_s):
    st = [False for _ in range(n)]
    ac, wa = 0, 0

    for p, s in p_s:
        if st[p - 1]:
            continue

        if s == "AC":
            ac += 1
            st[p - 1] = True
        if s == "WA":
            wa += 1

    print(ac, wa)


if __name__ == "__main__":
    n, m = map(int, input().split())
    p_s = [list(map(int, input().split())) for _ in range(m)]

    main(n, m, p_s)
Problem p02817 (python)

Fixed submission:
def main(s, t):
    print(t, s, sep="")


if __name__ == "__main__":
    s, t = input().split()

    main(s, t)

Buggy submission (verdict: Runtime Error):
s = input()
print(s.repliace(' ', ''))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.repliace(' ', '')
Problem p02848 (python)

Fixed submission:
from string import ascii_uppercase as ascii


def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)

Buggy submission (verdict: Runtime Error):
def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)
Problem p02853 (python)

Fixed submission:
def main(x: int, y: int):
    award = 0

    if x == y == 1:
        award += 400000

    for i in [x, y]:
        if i == 1:
            award += 300000
        elif i == 2:
            award += 200000
        elif i == 3:
            award += 100000

    print(award)


if __name__ == "__main__":
    x, y = map(int, input().split())

    main(x, y)

Buggy submission (verdict: Runtime Error):
def main(x: int, y: int):
    award: int = 0

    if (x and y) == 1:
        award += 400000

    for i in [x, y]:
        if i == 1:
            award += 300000
        elif i == 2:
            award += 200000
        elif i == 3:
            award += 100000

    print(award)


if __name__ == "__main__":
    x, y = map(int, input().split())

    main(x, y)
Problem p02898 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, K: int, h: "List[int]"):
    persons = 0

    for _h in h:
        if _h >= K:
            persons += 1

    print(persons)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, h)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from typing import List


def solve(N: int, K: int, h: "List[int]"):
    persons = 0

    for _h in h:
        if _h >= K:
            persons += 1

    print(persons)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, h)


if __name__ == '__main__':
    main()
Problem p02910 (python)

Fixed submission:
import re


def main(s: str):
    if re.match(r'^([^L][^R])*[^L]?$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)

Buggy submission (verdict: Runtime Error):
def main(s: str):
    if re.match(r'^([^L][^R])*[^L]$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)
Problem p02921 (python)

Fixed submission:
def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S = input()
    T = input()
    print(main(S, T))

Buggy submission (verdict: Runtime Error):
def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S, T = map(str, input().split())
    print(main(S, T))
Problem p02952 (python)

Fixed submission:
def main(n):
    count = 0

    for i in range(1, n + 1):
        if len(str(i)) % 2 == 1:
            count += 1

    print(count)


if __name__ == "__main__":
    n = int(input())

    main(n)

Buggy submission (verdict: Runtime Error):
def main(n):
    count = 0

    for i in range(n + 1):
        if str(i).__len__ % 2 == 1:
            count += 1

    print(count)


if __name__ == "__main__":
    n = int(input())

    main(n)
Problem p03001 (python)

Fixed submission:
def main(W: int, H: int, x: int, y: int):
    area = W * H
    count = 0

    if x * 2 == W and y * 2 == H:
        count = 1

    print("{:.6f}".format(area / 2), count)


if __name__ == "__main__":
    W, H, x, y = map(int, input().split())

    main(W, H, x, y)

Buggy submission (verdict: Runtime Error):
import math
W, H, x, y = map(int, input().split(' '))

f_x, i_x = math.modf(W / x)
f_y, i_y = math.modf(H / y)

if f_x == 0 and f_y == 0:
    print(float(W * y), 1)
elif f_x == 0:
    print(float(H * x), 0)
elif f_y == 0:
    print(float(H * x), 0)