ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1315. MDPAR and MIIAR

Show all messages Hide all messages

Another request to clarify... Oberon (Yura Znovyak) 18 Apr 2004 21:09
Hi!

I have few questions about this tasks.

1-st) How do we enumerate Y coordinate?
If assuming following sample test case
##..##..#
##.#.####
##.....x# 2
#########
Where x is speleologist we can have 2 variants:

##..##..# 0  4
##.#.#### 1  3
##.....x# 2  2
######### 3  1

I think surface = 0 must be the correct one, because then I have
WA on 9-th case else I have WA on 4-th.

2-nd) How should we calculate amount of swimmed blocks?
In another words: what is length of straight route from (1; 2) to
(1, 4): it goes through 3 cells: (1; 2), (1; 3) and  (1; 4)
and if we consider centers then route has length of 2.

Lets consider sample test case where w means water
##ww##ww#
##w#!####
##wwwwww#
#########
First we can swim 4 left and 1 up -> we are at ! symbol. Now we
have to swim up to the surface:
##5w##ww#
##4#!####
##321www#
#########
So we are currently on surface in 5 moves so both answers should be
"Can be rescued by himself".

Could you please point place where I had mistaken...
Hey! Where are my clarifications? (-) Oberon (Yura Znovyak) 20 Apr 2004 16:45
Re: Another request to clarify... Антон Щепелин 10 May 2004 17:27
I had accepted this problem with following knowleges:
1)Y Coordinate enumerated from botton to top (from 1 to H)
or simply - left-dwon corner is (1,1)
2)Lets consider your test
##ww##ww#
##w#!####
##wwwwww#
#########, then

##0w##ww#
##1#5####
##234www#
#########
So,
"Rescue operation required"