Problem p02990 (python)

Fixed submission:
import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
    
n,k = map(int,input().split())
 
mod = 10**9 + 7
 
for i in range(1,k+1):
    x = combination_count(n-k+1,i) * combination_count(k-1, i-1)
    print(x%mod)

Buggy submission (verdict: Runtime Error):
 import math
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
  
 
  
p,q = map(int,input().split())
 
m = 10**9 + 7
for i in range(1,q+1):
  a =  combination_count(p+q-1,i) * combination_count(q-1,i-1)
  print(a%m)

Buggy submission (verdict: Runtime Error):
 import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
  
 
  
p,q = map(int,input().split())
 
 
m = 10**9 + 7
 
for i in range(1,q+1):
  a =  combination_count(p-q+1,i) * combination_count(q-1,i-1)
  print(a%m)

Buggy submission (verdict: Runtime Error):
import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
  
 
  
n,k = map(int,input().split())

m = 10**9 + 7
 
for i in range(1,k+1):
  a =  combination_count(n+k-1,i) * combination_count(k-1,i-1)
  print(b%m)

Buggy submission (verdict: Runtime Error):
import math
def c(x,y):
  if x<y or y<0:
    return 0
  if x == 0 or y == 0:
    return 1
  elif:
    s = math.factorial(n)
    t = math.factorial(n-k)
    u = math.factorial(k)
    return s//(t*u)

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

for i in range(1,k+1):
  sol = c(n-k+1,i)*c(k-1,i-1)
  m = 10**9 +7
  ans = int(sol%m)
  print(ans)

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

def c(x,y):
  return math.fractorial(x)//math.fractorial(x-y)*math.fractorial(y)

for i in range(1,k-1):
  sol = c(n+k-1,i)*c(k-1,i-1)
  ans = sol%(10**9+7)
  print(ans)

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

def c(x,y):
  return math.fractorial(x)//math.fractorial(x-y)*math.fractorial(y)

for in in range(1,k-1):
  sol = c(n+k-1,i)*c(k-1,i-1)
  ans = sol%(10**9+7)
  print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
def com(x,y):
  return math.factorial(x)//math.factorial(x-y)*math.factorial(y)

for i in range(1,k-1):
  t = com(n-k+i,i)
  s = com(k+i-1,i-1)
  u = int(s*t(10**9+7))
  print(u)

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
def com(x,y):
  return math.factorial(x)//math.factorial(x-y)*math.factorial(y)

for i in range(1,k-1):
  t = com(n-k+i,i)
  s = com(k+i-1,i)
  u = int(s*t(10**9+7))
  print(u)

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
def com(x,y):
  return math.factorial(x)//math.factorial(x-y)*math.factorial(y)

for i in range(1,k-1):
  t = int(com(n-k+i,i)*com(k-1.i-1))
  s = int(t%(10**9+7))
  print(s)

Buggy submission (verdict: Runtime Error):
import math
n,k = map(int,input().split())
def com(x,y):
  return(math.factorial(x)/math.factorial(x-y)*math.factorial(y))

for i in range(1,k-1):
  t = int(com(n,n-k+i)%(10**9+7))
  print(t)

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


import math
i = 1

while i <= k:
  x = int(math.factorial(n-k+i)/((math.factorial(n-k))*(math.factorial(i))))
  print(int(x%((10**9) + 7)))
  i += 1

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


import math
i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))/(math.factorial(i))))%(10**9 + 7))
  i += 1

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())

import math
i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))/(math.factorial(i))))%(10**9 + 7))
  i += 1

Buggy submission (verdict: Runtime Error):

n = int(input())
k = int(input())

import math
i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))*(math.factorial(i))))%(10**9 + 7))
  i += 1

Buggy submission (verdict: Runtime Error):

n = int(input())
k = int(input())

import math
i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))*(math.factorial(i))))%(10**9 + 7))
  i += 1

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
k = int(input())

i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))*(math.factorial(i))))%(10**9 + 7))
  i += 1

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
k = int(input())

i = 1

while i <= k:
  print(int(math.factorial(n-k+i)/(math.factorial(n-k))*(math.factorial(i))))
  i += 1

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
k = int(input())

i = 1

while i <= k:
  print(int(math.factorial(n-i)/(math.factorial(n-i))*(math.factorial(i))))
  i += 1