![:D](./images/smilies/icon_biggrin.gif)
11581 - Grid Successors
Moderator: Board moderators
11581 - Grid Successors
I think this problem can't be a cycle...but why??? Can someone give me a proof please ![:D](./images/smilies/icon_biggrin.gif)
![:D](./images/smilies/icon_biggrin.gif)
Last edited by f74956227 on Fri Feb 27, 2009 12:36 pm, edited 1 time in total.
electron
Re: 11581 - Grid Successors
Check the first sample..
Its f0(g). We can find f1(g) easily.
f1(g) = f( f0(g) )
This way we can construct all.
So,
fI(g) = f4(g). Here 'I' stands for infinity. So, 3 is the highest index for which the result is finite. So, the result is 3. Hope it helps.
Code: Select all
111
100
001
f1(g) = f( f0(g) )
This way we can construct all.
So,
Code: Select all
f0(g) =
111
100
001
f1(g) =
001
100
110
f2(g) =
110
101
011
f3(g) =
010
101
010
f4(g) =
000
000
000
f5(g) =
000
000
000
...
Ami ekhono shopno dekhi...
HomePage
HomePage
Re: 11581 - Grid Successors
Thank you!! I think this problem will always convergence to the zero matrix (3x3) for every grid, but i can't prove this. Actually my AC program shows the
feature.
feature.
electron
Re: 11581 - Grid Successors
Hey all, having trouble getting WA and tried some rudimentary test cases. Formatting looks good. Any hints?
DELETED - missed the new line at the very end =/
DELETED - missed the new line at the very end =/
Last edited by priorm on Sat Nov 30, 2013 6:55 am, edited 2 times in total.
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11581 - Grid Successors
Use class Main
Check input and AC output for thousands of problems on uDebug!
Re: 11581 - Grid Successors
Sorry. Edited my response - (I modify my code to conform to the java submission instructions just prior to submitting)
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11581 - Grid Successors
Print a newline char at the end of the last line.
Check input and AC output for thousands of problems on uDebug!
Re: 11581 - Grid Successors
ugh, thanks!
Re: 11581 - Grid Successors
Jan,
Thanks for the explanation. That really helped see things in perspective.
Also, I've uploaded input I found useful during testing / debugging on uDebug.
Thanks for the explanation. That really helped see things in perspective.
Also, I've uploaded input I found useful during testing / debugging on uDebug.