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 1191. Catch the thief!

Could someone explain me the statement of the problem?(+)
Posted by Algorist 5 Mar 2002 03:33
Where do the intervals start from? And why doesn't it matter the
legth of the tram travels? I mean, it must matter for the interval of
the trams....... Explain PLZ
Hmm... (+)
Posted by MadPsyentist/Sam 5 Mar 2002 05:29
any time the robber come to the i-th stop, he have to wait for ti (time
interval) minutes ,a tram will come and the interval starts.

most of problems in this contest are very ambigious, i had to guest
many times to know what they want.

please explain me about 1190
About 1190
Posted by Algorist 5 Mar 2002 14:25
First, 10x about the explanation. I'll try to solve it having that in
mind.
About 1190-> I had problems with understanding it, too. Maybe you
should read the comments on board 1190. Some people helped me there.
You should have these in mind :
0) Percents should be non-increasing, not strictly decreasing
1) Names contain no intervals
2) Try both the possiblities-> the maximum one and the minimum one.
If the maximum is less than 10000, then NO. If the minimum is more
than 10000 than NO again. If the percents are not non-increasing->
NO. Otherwise-> YES.

You should get AC with that.
More questions. Please help(+)
Posted by Algorist 5 Mar 2002 15:08
and what about the policeman? does he have to wait ti as well?
Because, if the counting for him starts with the arrival of the
robber at the tram stop, then it DOES matter the length of the
route... So, does the policeman have to wait ti minutes as well?
Another question-> If the distance (the lag-> L) is 2, and t1 is 2,
does the policeman catch the robber
I should explain with sample input case (+)
Posted by MadPsyentist/Sam 5 Mar 2002 20:53
15 4
7 3 13 6

1st stop
robber is here at time 0
and he go out when time 0+7
police is here at time 15
the next tram will come at time 21 (trams come at 7,14,21)

the length of route doesn't matter the time lag at all because their speed
are always equal. so i'll assume that it's 0.
2nd stop
robber arrive at 7
robber go 7+3=10
police arrive 21
police go 22 (10,13,16,19,22)

3rd stop
robber go 10+13 = 23
police come 22 and arrest the robber here before he can go
Then where is the mistake in my source? (+)
Posted by Algorist 5 Mar 2002 22:45
#include <stdio.h>

int main() {
int cop,n,ti,rob,i,st,ost,tmp;
    scanf("%d %d",&cop,&n);
    for (i=1;i<=n;i++) {
        scanf("%d",&ti);
        st=rob;
        rob+=ti;
       if (rob>=cop) {
           printf("YES\n");
           return 0;
        }
        st=cop-st;
        ost=st%ti;
        if (ost==0) ost=ti;
        cop+=(ti-ost);
    }
    printf("NO\n");
    return 0;
}



I tried with if (rob>cop) but I got WA. I tried to compare the
leaving times(i mean, compare the time when the cop catches the tram
and the time the robber catches the tram, and if they are the same or
the cop can catch an earlier tram, then YES... but WA too. What I do
is just implementing stepwisely what you told me-> in 'cop' i keep
the time of the cop, and in 'rob' the time of the robber... But WA.
Help plz?
(+)
Posted by MadPsyentist/Sam 6 Mar 2002 01:01
> #include <stdio.h>
>
> int main() {
> int cop,n,ti,rob,i,st,ost,tmp;
>     scanf("%d %d",&cop,&n);
>     for (i=1;i<=n;i++) {
>         scanf("%d",&ti);
>         st=rob;
>         rob+=ti;
>        if (rob>=cop) {
>            printf("YES\n");
>            return 0;
>         }
>         st=cop-st;
>         ost=st%ti;
>         if (ost==0) ost=ti;
>         cop+=(ti-ost);
>     }
>     printf("NO\n");
>     return 0;
> }

1.) initialize the variable rob to be 0!
2.) problem statement says "the policeman will have luck to overtake the
robber. For instance, if L *****<***** K1, then it may happen that
the policeman will reach the first stop, when the robber is still waiting
for the tram there." this implies that , if police reach the stop when the
robber is leaving , he just have to wait from the next tram.
so use condition "rob>cop" and comment "if (ost==0) ost=ti;" and you'll
get AC!
10x... I owe you a big 10x :) And if you need help on something I have solved-> never hesitate to ask!
Posted by Algorist 6 Mar 2002 01:25
Thank you in advance :) (-)
Posted by MadPsyentist/Sam 6 Mar 2002 04:55
>
Re: (+)
Posted by timgreen 3 Apr 2004 19:32
Thank you very much!
Re: Could someone explain me the statement of the problem?(+)
Posted by For the Lichking 26 Oct 2007 07:50
好像不是这样的吧?
我WA#3
Re: Could someone explain me the statement of the problem?(+)
Posted by zbwmqlw 29 May 2009 08:16
I don't think the statement is clearly, it may mislead someone like me...