|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[numbers] Disqualified!
Guys, I have just learned something grave. Here are two solutions my program produced:
Problem: 8, 19, 32, 64, 88, 24, 216 1: (((( 88 - 24 ) * 64 ) + 8 ) / 19 ) 2: (( 8 - (( 24 - 88 ) * 64 )) / 19 ) Now, replacing the numbers with letters: a = 8 b = 19 c = 24 d = 32 e = 64 f = 88 1: ((( 88 - 24 ) * 64 ) + 8 ) / 19 = ((f-c)*e + a)/b = (fe-ce+a)/b 2: ( 8 - (( 24 - 88 ) * 64 )) / 19 = (a-((c-f)*e))/b = (a-(ce-fe))/b = (a+(fe-ce))/b = (fe-ce+a)/b These two are identical. So although I thought my script was producing distinct results, I forgot that a '-' can have an effect on through a multiply or divide operator. That means I am disqualified, unfortunately. I'm rather sad about that. |
|
#2
|
|||
|
|||
|
[numbers] RE: Disqualified!
don't be so sad, I will be too!
I belive a lot of people will be disqualified and would not expect it. As of me, I'm not interested on the scripts that returns only distinct result, I'm interested to see the ones that shows lot of distinct results no matter if it shows non-distinct results, as my script does(my script can find results for 1,2,3,4,5,6,7,8,...,n,target), it just needs time to find them(more numbers=more time), thats why I only manage some permutations, so it would not find 100% of the results! Also my script is only 16KB, why Ivan's script took 1MB? I'll like to see that(sounds like a huge table somewhere)! Suerte! |
|
#3
|
||||||
|
||||||
|
[numbers] RE: RE: Disqualified!
Quote:
Here is a piece of my script: php Code:
That function is "only" 15920 lines long and means 362KB. I could have optimized that in order not to return an array with 7500 elements (reducing overhead), but the deadline was too near in order to do so. Also, the files with more-than-half-a-million pregenerated strings are pretty big... (y had problems loading all the solutions at once - that would break the 32MB memory limit- , so I had to split the strings into 6 files, with 100000 strings each) |
|
#4
|
|||
|
|||
|
[numbers] RE: Disqualified!
wow mine's only 7k
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [numbers] Disqualified! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|