10656 - Maximum Sum (II)

All about problems in Volume CVI. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

10656

Postby htl » Fri Jun 25, 2004 4:33 am

Could someone give me more test case?

How about the in/out below?

in:
5
1
2
3
0
0
3
1
1
1
3
0
0
0
0

out:
1 2 3
1 1 1
0
htl
Experienced poster
 
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan

Re: 10656

Postby angga888 » Fri Jun 25, 2004 7:48 am

htl wrote:How about the in/out below?

Same with my AC code. :wink:
User avatar
angga888
Experienced poster
 
Posts: 143
Joined: Sat Dec 21, 2002 11:41 am
Location: Indonesia

Postby pudinzi » Mon Jun 28, 2004 3:52 pm

I am also trying to solve this problem, but get WA always, I get the same output for given input in example and for yours.
Some more input:
Code: Select all
5
-1
10
-5
10
1
1
1
8
2
1
-1
1
-5
1
2
0
9
1
1
1
0
-10
0
0
2
1
0


and my output:
Code: Select all
10 -5 10 1
1
2 1
2 1
pudinzi
New poster
 
Posts: 5
Joined: Sat Jun 05, 2004 10:18 pm

Postby Adrian Kuegel » Mon Jun 28, 2004 4:28 pm

Your input is invalid.
Each of the next N lines contains a single non-negative integer.

Here is a valid test input to check your program:
5
0
1
0
1
0
0

Output should be
1 1
Adrian Kuegel
Guru
 
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Postby pudinzi » Tue Jun 29, 2004 7:33 pm

Thx Adrian, you are the greatest (although you already know that)...
pudinzi
New poster
 
Posts: 5
Joined: Sat Jun 05, 2004 10:18 pm

10656 - Need help

Postby Junayeed » Sun Aug 29, 2004 3:46 pm

Please help me for this problem. I am getting WA. I tried all input available in the forum. But still WA. Here is my code please check it out.

/* I got it now */

Thanks every body
Last edited by Junayeed on Mon Aug 30, 2004 2:54 pm, edited 1 time in total.
Junayeed
New poster
 
Posts: 50
Joined: Sat Oct 26, 2002 9:02 am
Location: Dhaka, Bangladesh

Postby krijger » Mon Aug 30, 2004 11:39 am

Two mistakes. First, you print a space after each number, and after the last number, you shouldn't. Second, in the method 'allZero' you loop from 0 to MD where you should loop from 0 to N.
Sample input to show your mistakes:
Code: Select all
2
3 4
1
0

Your output (spaces replaced by _):
Code: Select all
3_4_
<blank line>

Should be:
Code: Select all
3_4
0
krijger
New poster
 
Posts: 39
Joined: Wed Jul 21, 2004 12:35 am

Postby Junayeed » Mon Aug 30, 2004 2:56 pm

Thanks krijger.
I got ACC now but with P.E. .
Any way thanks u again

Junayeed
Junayeed
New poster
 
Posts: 50
Joined: Sat Oct 26, 2002 9:02 am
Location: Dhaka, Bangladesh

10656 - Maximum Sum (II)

Postby faltooreza » Tue Nov 30, 2004 2:31 pm

I can't understand what the hell problem means? Anyone please make me clear.... what to do in this problem......
faltoo
faltooreza
New poster
 
Posts: 2
Joined: Sun Sep 05, 2004 11:25 am
Location: Bangladesh

Postby prince56k » Tue Nov 30, 2004 9:32 pm

i don't know why u get so much confused in this problem. it's a mock test type problem. just print the subsequence which has maximum summation value from the given sequence. if the input is like,
3
2
0
5
then the output will be 2 5. if two sequence has the same value then we need to print the sequence which has minimal lenght. here 2 5 has 2 length but 2 0 5 would be length of 3
prince56k
New poster
 
Posts: 33
Joined: Fri Dec 12, 2003 10:32 pm
Location: BANGLADESH

Postby CodeMaker » Tue Dec 28, 2004 5:50 am

But is 2 5 a subsequence here? what does subsequence mean here? how can 2 5 be a sequence, there is a 0 in the middle , doesn't it seperate 2 and 5 into 2 subsequences or any combination of the numbers means a subsequence in this problem :o
Jalal : AIUB SPARKS
User avatar
CodeMaker
Experienced poster
 
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

defn of subsequence...

Postby sohel » Tue Dec 28, 2004 10:58 am

Definition of subsequence : subsequence is a term used to mean a sequence derived from a sequence S by discarding some of its terms.
-- from mathworld

So, in the above example 2 5 is a subsequence of the given sequence.
User avatar
sohel
Guru
 
Posts: 862
Joined: Thu Jan 30, 2003 5:50 am
Location: University of Texas at San Antonio

Postby CodeMaker » Fri Dec 31, 2004 3:46 am

hmm, thanks... looks like I have problems in basic :oops:
Jalal : AIUB SPARKS
User avatar
CodeMaker
Experienced poster
 
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Postby Stummer » Wed Jul 05, 2006 12:09 pm

Thanks to Adrian Kuegel :wink: !!! At last I got Accepted!
Stummer
New poster
 
Posts: 12
Joined: Sat Jul 01, 2006 12:16 pm
Location: Munich, Germany

can anyone tell why WA

Postby bishop » Sun Jul 22, 2007 8:10 pm

why this is wa
is there any critical way to solve
this
Code: Select all

bishop
New poster
 
Posts: 43
Joined: Fri May 04, 2007 12:57 pm

Next

Return to Volume CVI

Who is online

Users browsing this forum: No registered users and 0 guests