413 - Up and Down Sequences

Moderator: Board moderators

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Well, you add all neutral values to only one total, maybe any time you update sequences you should add neutrals to it and reset it to 0 (or something like that).

It is exactly why it fails on those two cases.

boshkash1986
New poster
Posts: 21
Joined: Tue Jan 10, 2006 12:25 am

7 6 6 6 6 7 3 2 1 2 0

7 6 6 6 6 7 3 2 1 2 0

concernig this input my accepted program gives me a different answer than yours . (it really confused me)

my output

Code: Select all

``````Nr values = 10:  1.000000 3.500000
``````
we disagree in the down ration you say it is 7 and i say it is 3.50

7->6 (count down)
6->6 (count down)
6->6 (countdown)
6->6 (count down) (count sequence down)
6->7(count up) (count seq up)
7->3(count down)
3->2 (count down)
2->1(count down)(count seq down)
1->2(count up) (count seq up)

so u have 7 down numbers in form of two sequence and so u got 3.500

am i correct?

iishaque
New poster
Posts: 5
Joined: Sun Apr 03, 2005 5:11 pm

413-Up Down Sequence

HI
I tried but I faled to understand the problem. If any one please explain the problem. I can not understand the input output.
PLZ HELP ME

turcse143
Learning poster
Posts: 81
Joined: Wed May 09, 2007 9:59 pm

Re: help..help..hellllppp!!!! 413

Here is some input-output. I got PE.ples help.
input:

Code: Select all

``````1 2 3 0
3 2 1 0
1 2 3 2 1 0
2 2 2 2 3 0
4 4 4 4 3 0
4 4 4 3 3 3 3 0
4 4 4 3 3 3 4 0
5 5 5 5 0
1 2 3 2 3 4 5 0
0
``````
Output:

Code: Select all

``````Nr values = 3: 2.000000 0.000000
Nr values = 3: 0.000000 2.000000
Nr values = 5: 2.000000 2.000000
Nr values = 5: 4.000000 0.000000
Nr values = 5: 0.000000 4.000000
Nr values = 7: 0.000000 6.000000
Nr values = 7: 1.000000 5.000000
Nr values = 4: 0.000000 0.000000
Nr values = 7: 2.500000 1.000000
Press any key to continue
``````
Is there any mistake?
''I want to be most laziest person in the world''

turcse143
Learning poster
Posts: 81
Joined: Wed May 09, 2007 9:59 pm

Re: help..help..hellllppp!!!! 413

I got it . it was a little mistake.
''I want to be most laziest person in the world''

turcse143
Learning poster
Posts: 81
Joined: Wed May 09, 2007 9:59 pm

Re: help..help..hellllppp!!!! 413

I got it . it was a little mistake.
''I want to be most laziest person in the world''

anacharsis
Learning poster
Posts: 69
Joined: Mon Feb 09, 2015 1:56 am

Re: 413 - Up and Down Sequences

How can the answer to the 4th test case:
2 2 2 2 3 0
possibly be:
Nr values = 5: 4.000000 0.000000

Since there are 4 2's followed by a three, I see 5 "up" series of length 1, 2, 3, 4, 5.
So, given that there are 5, shouldn't the average length be 3??

Since so many have gotten this one, and no one is complaining about the sample IO, I assume it's right.
I must be understanding this wrong then.