Sort by

recency

|

37 Discussions

|

  • + 0 comments

    Just a little point, the tests view 1/3 + 1/6, as a different solution from 1/6 + 1/3 (i.e with the x and y values swapped). I felt 1/3 + 1/6 & 1/6 + 1/3 to be the same solution.

  • + 0 comments

    I can't understand the problem. Can anyone explain it step by step? best tantrik in Madurai

  • + 0 comments

    !/bin/python3

    import math import os import random import re import sys

    isprime = [True] * 1000000 prime = [] SPF = [None] * 1000000 def manipulated_seive(N): # 0 and 1 are not prime isprime[0] = isprime[1] = False

    # Fill rest of the entries 
    for i in range(2, N): 
    
        # If isPrime[i] == True then i is 
        # prime number 
        if isprime[i] == True: 
    
            # put i into prime[] vector 
            prime.append(i) 
    
            # A prime number is its own smallest 
            # prime factor 
            SPF[i] = i 
    
        # Remove all multiples of i*prime[j] 
        # which are not prime by making is
        # Prime[i * prime[j]] = false and put
        # smallest prime factor of i*Prime[j]
        # as prime[j] [ for exp :let i = 5 , j = 0 ,
        # prime[j] = 2 [ i*prime[j] = 10 ] 
        # so smallest prime factor of '10' is '2' 
        # that is prime[j] ] this loop run only one 
        # time for number which are not prime 
        j = 0
        while (j < len(prime) and
               i * prime[j] < N and
                   prime[j] <= SPF[i]):
    
            isprime[i * prime[j]] = False
    
            # put smallest prime factor of i*prime[j] 
            SPF[i * prime[j]] = prime[j]
    
            j += 1
    

    def solve(n): # Write your code here manipulated_seive(n+1) power=[] for i in prime: lim=int(math.log(n,i)) s=sum([n//(i**j) for j in range(1,lim+1)]) power.append(s) result=1 for i in power: result*=2*i+1 return result%1000007

    if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')

    n = int(input().strip())
    
    result = solve(n)
    
    fptr.write(str(result) + '\n')
    
    fptr.close()
    
  • + 0 comments
    #!/bin/python3
    
    import os
    import sys
    
    # n = N!
    # x + y = xy / n
    # xn + yn = xy
    # xy - xn - yn + n^2 = n^2
    # (x-n)(y-n) = n^2
    # XY = n^2
    # answer is number of factors of N!^2
    
    # Complete the solve function below.
    def count(n, p):
        count = 0
        n_copy = n
        while n_copy > 1:
            count += n_copy // p
            n_copy //= p
        return count
    
    def solve(n):
        pr = 1
        isprime = [True] * (n + 1)
        for num in range(2, n + 1):
            if not isprime[num]: 
                continue
            pr = pr * (2 * count(n, num) + 1) % 1000007
            for multiple in range(2 * num, n + 1, num):
                isprime[multiple] = False
        return pr
    
    if __name__ == '__main__':
        fptr = open(os.environ['OUTPUT_PATH'], 'w')
        n = int(input())
        result = solve(n)
        fptr.write(str(result) + '\n')
        fptr.close()
    
  • + 1 comment

    Thanks for the mathematics problem solution on your forum and that would be great help as well. The students who are facing the problems about and need the solution can get the answer here easily. Thumbs up and please do share research paper writing services uk further sharing must visit for more.