# Project Euler #187: Semiprimes

# Project Euler #187: Semiprimes

riyadali + 1 comment Java was used to create a working solution that ran in under 2 seconds for the worst case scenarion (20 testcases with N having a maximum value of 100 million in all of these cases and each test result was computed independently -- so no time savings because the testcase was the same in all of these instances)

The challenging part of this solution was efficently computing the primes up to 50 million (maximum N divided by smallest prime) and saving them in an array. This is done once. This array is then referenced in all of the test cases to produce the results desired.

mark_verleg + 0 comments [deleted]

ronyv89 + 0 comments I am getting runtime error when using Go for 2 test cases: 1 & 22. I tested for 20 test cases in the custom input box and I am getting run time error. In my local machine, there is no runtime error. Is there any specific reason for this?

andres_puente21 + 0 comments Where can I find the input and expected output for each test case?

Premprakash1234 + 1 comment Can sum1 explain me how the sample out put answer is 1 for the input of 5. ? condition of N is shd strt from 5 and input value itself 5 so only one value ie 5.

so how 5 value contains 2 prime factors ? if(1 and 5) then all the provided example input was wrong isnt it ?

Thanks in advance

_master + 0 comments The output we've to give is no. of semiprimes less than 5. Only semiprime less than 5 is 4. hence answer is 1.

Sort 22 Discussions, By:

Please Login in order to post a comment