Patience
-
- Posts: 61
- Joined: Wed Apr 30, 2008 3:31 am
Hi,
I solved that challenge by optimizing and thinking about what really is relevant for getting the right answer ... still it took a few mins till it printed out the right number ... so if it took just secondes and you didn't do more than taking away that slowing-down-lines inside the loop ... i guess something else is wrong.
I solved that challenge by optimizing and thinking about what really is relevant for getting the right answer ... still it took a few mins till it printed out the right number ... so if it took just secondes and you didn't do more than taking away that slowing-down-lines inside the loop ... i guess something else is wrong.
Hi,
I don't really get why you test the numbers the way you do ... all i can tell you, that the correct number occurs much later in the sequence than i=111, MUCH later. I can't tell you how much later, that would spoil to much.
I don't understand what you are doing (but i guess alot of approaches might work here ... so your approach might be correct).
This is really about optimization, so keep the approach from the original and just speed it up.
Ok, here is one major hint: BigIntegers are very slow ... and you can solve this without them.
If anyone thinks that spoils to much just tell me and I'll edit that part out.
I don't really get why you test the numbers the way you do ... all i can tell you, that the correct number occurs much later in the sequence than i=111, MUCH later. I can't tell you how much later, that would spoil to much.
I don't understand what you are doing (but i guess alot of approaches might work here ... so your approach might be correct).
This is really about optimization, so keep the approach from the original and just speed it up.
Ok, here is one major hint: BigIntegers are very slow ... and you can solve this without them.
If anyone thinks that spoils to much just tell me and I'll edit that part out.
The Java Random class is explicitly defined to use a certain algorithm, in order to assure repeatability of the generated sequences regardless of implementation or architecture. I'm not a Java expert, but I'd guess that if J# veers from the standard implementation then it's broken - maybe it provides a compatibility option though?
That said, maybe J# is documented as being based on a totally different implementation of the standard library. I dunno. I guess J# just isn't Java, in the same way that "managed" C++ is not C++.
That said, maybe J# is documented as being based on a totally different implementation of the standard library. I dunno. I guess J# just isn't Java, in the same way that "managed" C++ is not C++.
Erm... I don't get it... but from my point of view the solution is completely independent
from the RNG. The RNG defines just the starting point of each calculation.
One should find the same solution just by trying all possibilities with brute force...
although this would take "a bit" longer to computer.
from the RNG. The RNG defines just the starting point of each calculation.
One should find the same solution just by trying all possibilities with brute force...
although this would take "a bit" longer to computer.
This would only be the case if there is exactly one number that satisfies the criteria.megabreit wrote:Erm... I don't get it... but from my point of view the solution is completely independent
from the RNG. The RNG defines just the starting point of each calculation.
One should find the same solution just by trying all possibilities with brute force...
although this would take "a bit" longer to computer.