Older Contests
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP ContestsOlder Contests

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 4th, 2003, 05:08 PM
-vertigo- -vertigo- is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Louth, Lincolnshire
Posts: 314 -vertigo- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 2
[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.

Reply With Quote
  #2  
Old November 5th, 2003, 02:02 AM
rolosworld rolosworld is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 20 rolosworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to rolosworld
[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!

Reply With Quote
  #3  
Old November 5th, 2003, 03:55 PM
ivansanchez ivansanchez is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Madrid, Spain
Posts: 35 ivansanchez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to ivansanchez
[numbers] RE: RE: Disqualified!

Quote:
Also my script is only 16KB, why Ivan's script took 1MB? I'll like to see that(sounds like a huge table somewhere)!


Here is a piece of my script:

php Code:
Original - php Code
  1.  
  2.  
  3. function hard_operate5($array,$can_sum)
  4. {
  5.  
  6.     list($a,$b,$c,$d,$e) = $array;
  7.  
  8. if ($can_sum)
  9. return(array
  10. (($a+$b+$c+$d+$e)
  11. ,($a+$b+$c+$d-$e)
  12. ,($a+$b+$c-$d+$e)
  13. ,($a+$b+$c-$d-$e)
  14. ,($a+$b-$c+$d+$e)
  15. ,($a+$b-$c+$d-$e)
  16. ,($a+$b-$c-$d+$e)
  17. ,($a+$b-$c-$d-$e)
  18. ,($a-$b+$c+$d+$e)
  19. ,($a-$b+$c+$d-$e)
  20. ,($a-$b+$c-$d+$e)
  21. ,($a-$b+$c-$d-$e)
  22. ,($a-$b-$c+$d+$e)
  23. ,($a-$b-$c+$d-$e)
  24. ,($a-$b-$c-$d+$e)
  25. ,($a-$b-$c-$d-$e)
  26. ,($a+$b+$c+($d*$e))
  27. ,($a+$b+$c-($d*$e))
  28. ...
  29. ...
  30. ...
  31. ,(((($e/$a)+$d)*$c)+$b)
  32. ,(((($e/$a)+$d)*$c)-$b)
  33. ,(((($e/$a)+$d)/$c)+$b)
  34. ,(((($e/$a)+$d)/$c)-$b)
  35. ,(($c/(($e/$a)+$d))+$b)
  36. ,(($c/(($e/$a)+$d))-$b)
  37. ,(((($e/$a)-$d)*$c)+$b)
  38. ,(((($e/$a)-$d)*$c)-$b)
  39. ,(((($e/$a)-$d)/$c)+$b)
  40. ,(((($e/$a)-$d)/$c)-$b)
  41. ,(($c/(($e/$a)-$d))+$b)
  42. ,(($c/(($e/$a)-$d))-$b)
  43. ));
  44. else
  45. return(array
  46. (($a*$b*$c*$d*$e)
  47. ,($a*$b*$c*$d/$e)
  48. ,($a*$b*$c/$d*$e)
  49. ,($a*$b*$c/$d/$e)
  50. ,($a*$b/$c*$d*$e)
  51. ,($a*$b/$c*$d/$e)
  52. ,($a*$b/$c/$d*$e)
  53. ,($a*$b/$c/$d/$e)
  54. ,($a/$b*$c*$d*$e)
  55. ,($a/$b*$c*$d/$e)
  56. ,($a/$b*$c/$d*$e)
  57. ,($a/$b*$c/$d/$e)
  58. ,($a/$b/$c*$d*$e)
  59. ,($a/$b/$c*$d/$e)
  60. ...
  61. ...
  62. ...
  63. ,(((($a-$e)/$d)+$c)*$b)
  64. ,(((($a-$e)/$d)+$c)/$b)
  65. ,($b/((($a-$e)/$d)+$c))
  66. ,(((($a-$e)/$d)-$c)*$b)
  67. ,(((($a-$e)/$d)-$c)/$b)
  68. ,($b/((($a-$e)/$d)-$c))
  69. ,((($d/($a-$e))+$c)*$b)
  70. ,((($d/($a-$e))+$c)/$b)
  71. ,($b/(($d/($a-$e))+$c))
  72. ,((($d/($a-$e))-$c)*$b)
  73. ,((($d/($a-$e))-$c)/$b)
  74. ,($b/(($d/($a-$e))-$c))
  75. ));
  76.  
  77. }


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)

Reply With Quote
  #4  
Old November 5th, 2003, 09:50 PM
FryGuy1013 FryGuy1013 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Antelope, Ca
Posts: 45 FryGuy1013 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to FryGuy1013 Send a message via AIM to FryGuy1013 Send a message via Yahoo to FryGuy1013
[numbers] RE: Disqualified!

wow mine's only 7k

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP ContestsOlder Contests > [numbers] Disqualified!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway