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.
And - please don't create new thread if one already exists.
413 - Up and Down Sequences
Moderator: Board moderators
-
- 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
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?
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
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?
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![:cry:](./images/smilies/icon_cry.gif)
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
![:cry:](./images/smilies/icon_cry.gif)
-
- Learning poster
- Posts: 81
- Joined: Wed May 09, 2007 9:59 pm
- Location: (CSE,DU) Dhaka,Bangladesh
Re: help..help..hellllppp!!!! 413
Here is some input-output. I got PE.ples help.
input:
Output:
Is there any mistake?
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
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
''I want to be most laziest person in the world''
-
- Learning poster
- Posts: 81
- Joined: Wed May 09, 2007 9:59 pm
- Location: (CSE,DU) Dhaka,Bangladesh
Re: help..help..hellllppp!!!! 413
I got it . it was a little mistake.
''I want to be most laziest person in the world''
-
- Learning poster
- Posts: 81
- Joined: Wed May 09, 2007 9:59 pm
- Location: (CSE,DU) Dhaka,Bangladesh
Re: help..help..hellllppp!!!! 413
I got it . it was a little mistake.
''I want to be most laziest person in the world''
-
- 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.
Can someone please explain the correct way to think about this?
Thanks!
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.
Can someone please explain the correct way to think about this?
Thanks!
-
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
Re: 413 - Up and Down Sequences
The problem statement is not so clear.
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.