10656 - Maximum Sum (II)

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

Moderator: Board moderators

technobug
Learning poster
Posts: 88
Joined: Sat Nov 15, 2003 6:41 pm
Location: Brasilien
Contact:

Post by technobug » Sat May 22, 2004 7:24 pm

Maniac wrote:EriK (<- note the K)

P.S. Does anyone know why so many people tend to write my name in the wrong way when there's no reason to assume I mistyped my own name in previous messages?
Oopss... maybe cause Erik in portuguese would be written with a 'c'?
I was just too lazy to check your name again when I wrote it :)

Sorry Erik :)

Maniac
Experienced poster
Posts: 105
Joined: Tue Oct 14, 2003 3:24 pm
Location: Utrecht, Holland

Post by Maniac » Mon May 24, 2004 6:42 pm

That's OK technobug, it happens all the time :-)
Maybe worldwide the name Eric is more common than Erik is...

shahriar_manzoor
System administrator & Problemsetter
Posts: 399
Joined: Sat Jan 12, 2002 2:00 am

Explanation

Post by shahriar_manzoor » Tue May 25, 2004 12:09 am

Well so many words and now something to say. I just prepared everything for this contest in two days and also not two days full work because somehow there was not enough time. Problem F was from remote past and was from a mock contest of our local contest. No one found any mistake during that contest and as it was a mock contest problem we did not check it seriously.

After such a long time I put this problem without checking (Assuming it was correct). During contest I was not online (My internet was out of order) so it was impossible for me to put a clarification although I was already informed that there was a mistake. At first it was very difficult to find that the problem was wrong as so many people got accepted for F.

technobug
Learning poster
Posts: 88
Joined: Sat Nov 15, 2003 6:41 pm
Location: Brasilien
Contact:

Post by technobug » Tue May 25, 2004 4:04 am

i believe manzoor is right.... sometimes we dont give out the credits.... although the problem really sucks AS IS, he has put some great effort on this web site....

anyhow, when the problem get to the archive will it be with a sensefull statement?

htl
Experienced poster
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan

10656

Post by 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

User avatar
angga888
Experienced poster
Posts: 143
Joined: Sat Dec 21, 2002 11:41 am
Location: Indonesia

Re: 10656

Post by angga888 » Fri Jun 25, 2004 7:48 am

htl wrote:How about the in/out below?
Same with my AC code. :wink:

pudinzi
New poster
Posts: 5
Joined: Sat Jun 05, 2004 10:18 pm

Post by 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

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

Post by 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

pudinzi
New poster
Posts: 5
Joined: Sat Jun 05, 2004 10:18 pm

Post by pudinzi » Tue Jun 29, 2004 7:33 pm

Thx Adrian, you are the greatest (although you already know that)...

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

10656 - Need help

Post by 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.

krijger
New poster
Posts: 39
Joined: Wed Jul 21, 2004 12:35 am

Post by 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

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

Post by Junayeed » Mon Aug 30, 2004 2:56 pm

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

Junayeed

faltooreza
New poster
Posts: 2
Joined: Sun Sep 05, 2004 11:25 am
Location: Bangladesh

10656 - Maximum Sum (II)

Post by 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

prince56k
New poster
Posts: 33
Joined: Fri Dec 12, 2003 10:32 pm
Location: BANGLADESH

Post by 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

User avatar
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by 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

Post Reply

Return to “Volume 106 (10600-10699)”