Sort by

recency

|

4 Discussions

|

  • + 0 comments

    Glad to have the coding stuff on your forum and that would be helpful for the beginners as well. there should be the students who might facing same problem can avail the bestessay review solution from experts and can ask for it while creating new thread.

  • + 0 comments

    PyPy 3 solution

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    MOD = 10 ** 9 + 7
    
    def sieve(n):
        l = [True] * n
        ps = []
        for i in range(2, n):
            if l[i]:
                ps.append(i)
                for j in range(i * i, n, i):
                    l[j] = False
        return ps
    
    primes = sieve(10 ** 4)
    
    def pascal(n):
        rows = [[1]]
        for i in range(n):
            rows.append([(a + b) % MOD for (a, b) in zip(rows[-1] + [0], [0] + rows[-1])])
        return rows
    
    binom_ = pascal(3005)
    def binom(n, k):
        if k < 0 or k > n: 
            return 0
        return binom_[n][k]
        
    def prime_exploration(p, n, d):
        if d == 1: 
            return p ** n
        s = 0
        pp = 1
        for k in range(n + 1):
            s += pp * binom(n - k + d - 2, d - 2)
            pp = p * pp % MOD
        return s % MOD
    
    def divisor_exploration(m, a, d):
        prod = 1
        for i in range(m):
            x = prime_exploration(primes[i], a + i + 1, d)
            prod = prod* x % MOD
        return prod
    
    for i in range(int(input())):
        print(divisor_exploration(*map(int, input().split())))
    
  • + 0 comments

    Fully supports playing via computer. All channels slotxo

  • + 0 comments

    Somewhere in the solution it's said depth 'i', while in the question it's i'th prime. This makes the indices used in the solution confusing.

No more comments