|
|
back to boardWhy I always got time exceeded?How to improve my program?I want to know the best algorithm. Re: Why I always got time exceeded?How to improve my program?I want to know the best algorithm. I think that there is a simple formula that is going to work.... Does there any mathymatical formula exit?Or I have to improve my enumerating algorithm? > I think that there is a simple formula that is going to > work.... Re: Why I always got time exceeded?How to improve my program?I want to know the best algorithm. I know the answer when (n mod 4)=3 The answer is +a^((n+1)/4), -a^((n+1)/4) But I don't know the answer when (n mod 4)=1 Re: Why I always got time exceeded?How to improve my program?I want to know the best algorithm. an efficient algorithm for this problem requires knowing very much of number theory: Legendre Symbols and other (i've found them on the web). You could search the web for quadratic residues modulo n... if not found, I cand send you "my" source... |
|
|