WrongAnswer #28

*Edited by author 29.05.2020 13:26*

*Edited by author 29.05.2020 13:26*

Re: WrongAnswer #28

Try to change this

for (int i = 3; i <= Convert.ToInt32(Math.Ceiling(BigInteger.Log(n, 2))); i += 2)

to this

for (BigInteger i = 3; i * i <= n; i += 2)

Btw, you do not need BigInteger here, long is enough.

*Edited by author 30.05.2020 21:39*

Re: WrongAnswer #28

After this you will receive TLE39, try to handle the case with two big multiplied prime numbers, for example 1000000007*1000000009.

Edit: this is even easier, than I thought. Just change your for to

for (BigInteger i = 3; i < 10000000; i += 2)

*Edited by author 29.05.2020 03:42*

*Edited by author 29.05.2020 03:42*

Re: WrongAnswer #28

Thanks a lot,