Can you explain why the right most cell not be revealed ?
This is what I get as the weighted game :
****
235*
002*
0011
So if the first cell with 0 is clicked, I believe it should end up
revealing all...

On Sun, Apr 13, 2014 at 11:26 AM, Tsuyoshi Ito
<[email protected]>wrote:

> On Sunday, April 13, 2014 2:32:35 PM UTC+9, Dhruva Sagar wrote:
> > I decided to go with a spiral algorithm to place the mines until M mines
> are placed, from there I went ahead to calculate the weights for each of
> the remaining cells based on how many neighbors have mines and I selected
> the first mine with weight 0 as 'c' if present, if not then the answer
> would be impossible.
> >
> > However my answer seems to be rejected so if someone would be kind
> enough to throw some light on what I might be doing wrong it would be great!
>
> If I am guessing what you mean by “a spiral algorithm” correctly, then I
> am afraid that your algorithm is incorrect.  For example, consider the case
> where R=C=4, M=6.  If your algorithm produces something like
>
>   ****
>   ...*
>   c..*
>   ....
>
> then it is incorrect because the bottom-right square does not open
> automatically.
>
> Your explanation also suggests that your code outputs Impossible for, say,
> R=C=3, M=8, but this case is possible.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Code Jam" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-code/u8Zlclt-W6k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/b62d0911-e49f-4b6f-86b3-ac65b9b3394b%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thanks & Regards,
Dhruva Sagar <http://dhruvasagar.net>

   - g-talk : [email protected]
   - y! : [email protected]
   - github : github.com/dhruvasagar
   - work : dhruva.sagar@ac
<[email protected]>tivesphere.com<[email protected]>

----------------------------
Senior Ruby/Rails/Node.js Consultant
ActiveSphere <http://www.activesphere.com/>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAAJXOCA2%3DtMn%3DsTS4%3Da%2BnBdoqen_Wzc7rhkb5HvmNhdTTFhk%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to