ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1415. Mobile Life

1st question. (There're two kinds of understandings.)
Posted by Safe Bird 1 Nov 2005 13:26
If there're two stations that would give the signal as VIOLET, but one is stronger.
1. we choose the stronger.
2. we choose the one according to their names.

which one is right? anyway, i got wa on 4 on both of the meanings.

Edited by author 01.11.2005 21:21
2nd question
Posted by Safe Bird 1 Nov 2005 13:50
If the segment which our hero goes just tangentalled to the curves of change of the current signal's level, should I output twice "Signal Changed...."?

The condition is the same as above, if he just touches the curve of ORANGE, should I output:
Cell changed. CELL_ID:...., SIGNAL_LEVEL:ORANGE
Signal changed. SIGNAL_LEVEL:RED
?

Edited by author 01.11.2005 21:21
Incorrect case#3 (And what's more)
Posted by Safe Bird 1 Nov 2005 14:15
There's the line: "Also, we assume that at the points where the segments join, Shpuntik's phone never changed cells and that for each of the stations the curves of change of the signal's level do not pass through these points." in description.

I got wa on 4. And after putting this line to judge whether it suffers the condition above:

if (case_is_wrong) then DIE

I got RE on 3. I think at least case 3 is wrong, or the description is wrong!

Edited by author 01.11.2005 14:46
3rd question:
Posted by Safe Bird 1 Nov 2005 21:13
if we change the sample input to:

5 5 -20 -20
-20 -20 5 5

then we have:

Power on. CELL_ID:Znaika, SIGNAL_LEVEL:GREEN
Signal changed. SIGNAL_LEVEL:YELLOW
Signal changed. SIGNAL_LEVEL:ORANGE
Signal changed. SIGNAL_LEVEL:RED
Cell changed. CELL_ID:Romashka, SIGNAL_LEVEL:YELLOW
Signal changed. SIGNAL_LEVEL:ORANGE
Signal changed. SIGNAL_LEVEL:RED
// HERE, should I output the following line?
// I think we don't need, but by the description, we should...
Cell changed. CELL_ID:Romashka, SIGNAL_LEVEL:ORANGE
Signal changed. SIGNAL_LEVEL:YELLOW
Signal changed. SIGNAL_LEVEL:GREEN
Signal changed. SIGNAL_LEVEL:BLUE
Signal changed. SIGNAL_LEVEL:INDIGO
Signal changed. SIGNAL_LEVEL:VIOLET
Signal changed. SIGNAL_LEVEL:INDIGO
Signal changed. SIGNAL_LEVEL:BLUE
Signal changed. SIGNAL_LEVEL:GREEN
Signal changed. SIGNAL_LEVEL:YELLOW
Signal changed. SIGNAL_LEVEL:ORANGE
4th question:
Posted by Safe Bird 1 Nov 2005 21:18
If when the mobile turns on, it gets RED even to the closest station. Should I output:

Power on. CELL_ID:......, SIGNAL_LEVEL:RED
? or i should do something else?
5th question:
Posted by DWED 14 Nov 2005 18:06
Why there is zero-lenght line segment in 4-th test?
Re: 1st question. (There're two kinds of understandings.)
Posted by Aleksandr Klepinin 17 Nov 2005 11:06
If I am not mistaken, base station selection is made ONLY when power indicator shows RED. Otherwise we stay connected to currently selected base station (until power indicator gets RED) even if there is another one with stronger signal.
you misunderstood my question.
Posted by Safe Bird 24 Nov 2005 10:24
i means, while changing channel, which one should be chosen:

if there are two stations providing very strong signal, but the SAME COLOR. i should choose the closer one or according to their names.

in other words, i should choose according to the DISTANCE, or the COLOR of stations?
...sigh....
Posted by Safe Bird 24 Nov 2005 10:27
6th question
Posted by Fly [Yaroslavl_SU] 26 Nov 2005 08:33
3rd question: i think it isn't print, because we haven't event "signal lost" and may still assume what cell is same
...

My 6th question: should i use ( char * ) instead off ( unsigned char * ) or vise versa for names?
Re: 6th question
Posted by Michael Rybak (accepted@ukr.net) 26 Nov 2005 18:58
I disagree with you, Fly.

Question 1 - indeed, seems like we should choose the stronger signal, not the best color, but indicator is only  able to distinguish between colors, not strengths, so it's a bit unclear.

The answer to question 2 depends on what happends if distance is equal to critical.

Take a look:

1. "If the distance between the phone and a base station is less then a certain value, then the signal is ideal"

2. "If the phone is moved away from a base station further than the threshold distance, then the indicator goes indigo, then blue, green, and so on"

3. "Rc is its threshold distance within which the station's signal is shown by the violet color of the indicator"

These three statements can't be resolved clearly, IMHO. "within" means <=, while "less" means <.

As for question 4, it isn't really clear, because "The phone stays connected to the same station until its signal goes red; then it switches to the search mode and tries to select a new station", so we can't tell whether the phone is in search mode from the very beginning or no. Although this doesn't seem to affect our output, behaviour is poorly described for this problem.
Re: 6th question
Posted by Fly [Yaroslavl_SU] 26 Nov 2005 20:08
Questio #1. I don't know. I tried both and got WA#8.

Question #2. "If the distance between the phone and a base station is less then a certain value, then the signal is ideal".I think its right. "within which" means such as "inside which".

Question #4. "When the phone is being turned on, it selects a station with the strongest signal. If there are several such stations, then the station with the minimal (with respect to the lexicographic order) name of the cell is selected among them." Color isn't take to account.

Edited by author 26.11.2005 20:12
Re: 6th question
Posted by Fly [Yaroslavl_SU] 26 Nov 2005 20:55
Question #2.
<= get WA #6
< get WA #8
Question #4
Posted by Fly [Yaroslavl_SU] 27 Nov 2005 02:16
I right.
Re: 6th question
Posted by Michael Rybak (accepted@ukr.net) 27 Nov 2005 21:59
I agree to *answers* to your questions, but I disagree with reasons.

Indeed, your answers are correct and I got them as well by experimenting. What I claim to be wrong is uncertainty in problem statement; such details should be pointed out.
Re: 6th question
Posted by Denis Koshman 31 Aug 2008 08:26
It probably can be extrapolated from this phrase "Violet corresponds to the strongest signal". But then it turns out that the 1st picked station can be violet only (also _strongest_ signal), and if there is no violet station nearby, it's undefined behavior :D