hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Deluge

 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Deluge
Author Message
therethinker



Joined: 28 Mar 2008
Posts: 144
Location: #hacker.org on Freenode

Post Deluge Reply with quote
I think I've solved it: I've tested it on a few grids and they all work fine. It uses a proven method that has no reason *not* to work here.
I can't figure out why it's not flooding correctly.

Do I have to print the answer too, or do I leave it in memory?
Mon Dec 08, 2008 10:17 pm View user's profile Send private message AIM Address
adum



Joined: 19 Apr 2007
Posts: 390

Post Reply with quote
just leave it in memory.
Mon Dec 08, 2008 11:29 pm View user's profile Send private message Visit poster's website
Karian



Joined: 09 Jan 2008
Posts: 75

Post Reply with quote
I'm also having a problem with this one. I tested a few examples, including the example of the page, and some special cases, but I can't get my answer accepted. first I thought that it was a problem that for some reason the spaces were stripped, but even changing those to another value wouldn't help.
Tue Dec 09, 2008 9:39 am View user's profile Send private message
m!nus



Joined: 28 Jul 2007
Posts: 202
Location: Germany

Post Reply with quote
don't be too happy with your solution for deluge, the challenges that come after it are a "bit" more difficult.

i tried searching some more optimal algorithm but didn't find real code where i can see how it gets implemented :/
Tue Dec 09, 2008 9:08 pm View user's profile Send private message
Chocoholic



Joined: 16 Feb 2009
Posts: 44
Location: UK

Post Reply with quote
Uhm... I'm a bit confused about what this challenge is asking. So far I've got a program that correctly floods a few simple images, including the one from the page, but it still says that it doesn't flood correctly.

I might add that I based my program on the assumption that the top left pixel will only ever be 0 or 1. If it is 0 then the program floods correctly (as far as I can tell) and if it is 1 there is nothing to flood.

This assumption is based on the following two sentences from the description: Off pixels (the white ones in the sample image above) are zeroes. When your program terminates, all flooded pixels should have a value of 1.

Can anyone tell me if this is in fact correct?
Sat Jul 18, 2009 9:58 am View user's profile Send private message ICQ Number
gfoot



Joined: 05 Sep 2007
Posts: 269
Location: Brighton, UK

Post Reply with quote
I think your assumptions are correct. I seem to remember it just says you failed to flood correctly even if the actual problem was an error, e.g. exceeding the cycle count. So if your algorithm does work on test images, but not when submitted, it's likely that it's just taking too many cycles, and you need to optimise it.
Sun Jul 19, 2009 11:37 am View user's profile Send private message
guga



Joined: 02 Mar 2012
Posts: 17

Post Reply with quote
Hmm, this thread is old but for me the stated problem is still relevant.
My Program works fine on some sample inputs, including the one shown on the challenge-page and an empty grid. I'm always below 50k cycles, but the Program is not accepted (not flooding correctly).
Is there a limitation to the stack or call stack size? They are growing "quite big" (still < 1000) during the run.
I noticed some of those who had trouble with this as well finally solved this. So at least they should have an idea of what could be wrong with my program.

Any Hints?

thx
guga
Sat Nov 10, 2012 12:49 pm View user's profile Send private message
Hippo



Joined: 01 Feb 2014
Posts: 331
Location: Praha 5

Post Reply with quote
guga wrote:
Hmm, this thread is old but for me the stated problem is still relevant.
My Program works fine on some sample inputs, including the one shown on the challenge-page and an empty grid. I'm always below 50k cycles, but the Program is not accepted (not flooding correctly).
Is there a limitation to the stack or call stack size? They are growing "quite big" (still < 1000) during the run.
I noticed some of those who had trouble with this as well finally solved this. So at least they should have an idea of what could be wrong with my program.

Any Hints?

thx
guga


When tested on HVM, have you checked the result of the algorithm. Are there just ones and zeroes and are they where they should be? Write it on a square paper to check it....

Hmm, it would help to make local copy of hvm and make some changes to show resulting memory (and increasy cycle count if needed), or experiment with python implementation.
Mon Jun 17, 2019 10:26 am View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.