Page 1 of 1

10156 - Sala-ma-Sond, A Nice Little Pond

Posted: Thu Jan 02, 2003 10:35 pm
by Caesum
Seems like a relatively easy task and yet there are many wa's on this problem. Is there something here that I am not seeing ?

Posted: Thu Jan 02, 2003 10:50 pm
by zsepi
caesum is right, it didn't seem that difficult - however, I do get WA on it... is there any catch you can think about? is that possible that there is a command given to a turtle with non-existent id? but shouldn't one get runtime error (invalid memory reference) then? any ideas are welcome :)

Posted: Fri Jan 03, 2003 1:54 am
by Caesum
My last submission had a lot of assert's and there is not such a case as far as I can tell - the commands appear to be all for valid id's

Posted: Sat Jan 18, 2003 11:55 pm
by Caesum
It seems that within the list of turtles some of them have the same id - do you just take the latest one ? do some of these extra positions end up as ghosts in the solutions or something ?

Posted: Sun Jan 19, 2003 12:00 am
by Caesum
looks like it, i am now ac........ damn data is wrong for this problem

WA :

Posted: Thu Oct 30, 2003 12:05 pm
by sumankar
Can you elaborate a little further
Suman.

10156 Sala-ma-Sond, A Frustrating Little Pond

Posted: Sun Sep 26, 2004 10:28 am
by sohel
This problem seems to be a straight forward one and the problem statement seems to be well written..
.. but I keep getting WA.... around 20 submissions so far. :(
-- and the AC % seems to be low as well, so there must be something that I have missed out.

I just check whether a command takes a turtle to a position in the grid that is not occupied by some other turtle and move it there correspondingly .. otherwise I ignore the command.

Some help or clarification will be greatly appreciated.

Posted: Sun Sep 26, 2004 11:05 am
by little joey
Yes, it should be as easy as you describe. Don't you have your north-south and east-west dimensions mixed up? That is about the only thing that can go wrong. I guess you already remove trailing spaces, and print a blank line after each case, including the last.

Posted: Sun Sep 26, 2004 1:11 pm
by sohel
Yeah,

I do remove trailing spaces at the end.

I considered top-left point as (0, 0) to the right x increases and to the bottom y increases.

Suppose a turtle is at (5,3) then a SE command will move it to (6,4), right... ( provided the latter coordianate is valid ).

Another thing: if there are 10 rows and only row 1 and 2 contains turtle, then do you print 2 rows or 10 rows.

One last thing : Can there be invalid inputs.

Posted: Sun Sep 26, 2004 2:29 pm
by little joey
What I meant is, that the dimensions are given in the order "height width", so if the input says "10 3", the lower left point is (2,9) and not (9,2).

I always print all rows, even when they are empty.

I don't take special measures to avoid wrong input, so I suppose it's ok.

Posted: Mon Sep 27, 2004 2:22 pm
by sohel
LJ wrote: What I meant is, that the dimensions are given in the order "height width", so if the input says "10 3", the lower left point is (2,9) and not (9,2).
Shouldn't the lower left point be ( 0, 9 ) -- considering first parameter as x and the second as y... :-?

Posted: Mon Sep 27, 2004 2:56 pm
by little joey
Sorry, got left and right mixed up :oops: :oops: :oops:
(2,9) is the lower right point
So for 10 3 (10 rows, 3 cols):
(0,0) upper left
(2,0) upper right
(0,9) lower left
(2,9) lower right
(Hope I got it right this time).

yeaaaahh...

Posted: Sat Apr 09, 2005 1:41 pm
by sohel
Finally got AC. 8)

The problem was, in the judge's input.. there were cases where two turtles have the same id. In that case, you have to process the very last one when a command is given on that id..
.. but about the other turtles with the same id, they do occupy a position.
Just assume that these turtles are there with a different id and no command will be imposed on them.

So strictly speaking, the judge's input is wrong as the problem statement does not clarify about this matter.

10156 --> Still getting WA!

Posted: Mon Oct 09, 2006 4:09 am
by dontcry
No trailing spaces, blank line after every single case (even the last one). I'm doing all that already.

For turtles with the same id I'm only considerating the last one given, even though the first ones occupy a position on the grid, and therefore appear as turtles on the solution as well.

Am i missing anything? I'm still getting WA!!

Thank you so much