Sort 22 Discussions, By:
Please Login in order to post a 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.
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?
Where can I find the input and expected output for each test case?
why 5 is semiprime?
5 = 5*1
is only one single prime number, not two
5 is not a semi prime, 4 is. 4 is the only number less than 5 that has 2 prime factors
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
The output we've to give is no. of semiprimes less than 5.
Only semiprime less than 5 is 4. hence answer is 1.