Home > Back-end >  Pta platform on the topic, don't know where is wrong, could you tell me which bosses know, guid
Pta platform on the topic, don't know where is wrong, could you tell me which bosses know, guid

Time:06-07

CodePudding user response:

You this is timeout, needs to be improved algorithm efficiency

CodePudding user response:

reference 1st floor SuperDay response:
you this is timeout, needs to be improved algorithm efficiency

Oh oh, that is to say nothing wrong, just algorithm need to improve, right?

CodePudding user response:

Can blow SQRT (10000) of all prime Numbers are calculated, or directly in
Decomposition, and then on the prime table to do to find the minimum factor, and then combined

CodePudding user response:

Fun
reference 3 floor response:
can blow SQRT (10000) of all prime Numbers are calculated, or directly in
Decomposition, and then on the prime table to do to find the minimum factor, and then combined

Well, this, to be honest, do not understand

CodePudding user response:

The problem is that your factor decomposition algorithm to improve
Too many cycles factor is o
Is the biggest factor for an integer n, n/2 (if n is an even number), then more than n/2 cycle is necessary, to reduce this part of the cycle, speed increased a times
Similar is greater than n/3, how many factor? ,,,,,,,

Their prime algorithm to look for, can put the n first decomposed into several prime product, the prime number must not be greater than the SQRT (10000)=100
Don't even need to calculate the prime Numbers within 100, direct hit table will do.

And then all factors, not repeat the combinations between is the prime number, even if he is enough by testing the exhaustion rate





CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related