10618 - Tango Tango Insurrection

All about problems in Volume 106. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
tRipper
New poster
Posts: 22
Joined: Sun Mar 13, 2005 5:04 pm
Location: out there

10618 - Tango Tango Insurrection

Post by tRipper »

I'm trying to solve it using DP. I have a array best[71][6] in wich I store the lowest possible energy cost - first index shows the sign I'm currently on, and the second index shows my last move.

Moves are numbered:
0 for left foot on Left
1 for left foot on Up
2 for left foot on Down
3 for right foot on Up
4 for right foor on Down
5 for right foot on Right

I maintain this array best using a matrix table[j] in which there are energy costs for making move j if the last move was i.

For example:
table[0][0] would be 3 because I used the same foot but didn't change arrows
table[1][4] would be 1 because I used different foot
table[4][3] would be 7 because I used the same foot and moved it accros the pad (form Down to Up)
table [3][5] would be 5 because I used the same foot and moved it to a adjacent arrow (for Up to Right)

However, my program produces WA (0.139s)
I would very much appreciate if someone could point a flaw in my algorithm or tell me something useful on this problem.
Thanks
If I am out of my mind, it's all right with me.
Post Reply

Return to “Volume 106 (10600-10699)”