626 - Ecosystem

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

Moderator: Board moderators

Post Reply
Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

626 - Ecosystem

Post by Observer » Fri Dec 19, 2003 7:01 pm

Looks like I'm the only one in this board who has trouble on this task... :)

I would like to ask a simple little question: could any species possibly eat itself? I mean, would cases like this exists:
3
1 1 1
1 1 1
1 1 1
If so, how should I deal with such cases? Would anyone who got Accepted in this quesion give me some help, please......

Furthermore, I sure need some test cases for this problem. Please help!! :wink:
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

junjieliang
Experienced poster
Posts: 169
Joined: Wed Oct 31, 2001 2:00 am
Location: Singapore

Post by junjieliang » Sat Dec 20, 2003 6:03 am

My output:

1 2 3
3 2 1
total:2

The three numbers on each line should be different from each other.

Observer
Guru
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Post by Observer » Sat Dec 20, 2003 8:12 am

Thanks a lot!!! Got Accepted now :P :P :P
junjieliang wrote:The three numbers on each line should be different from each other.
Where can this statement be found? I still couldn't see it....
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org

junjieliang
Experienced poster
Posts: 169
Joined: Wed Oct 31, 2001 2:00 am
Location: Singapore

Post by junjieliang » Sun Dec 21, 2003 1:25 pm

I don't think the statement is found anywhere. The problem setter probably thought it obvious that a species cannot consume itself. Of course test cases on the OJ rarely fit into actual real life conditions, but I guess this problem does. :lol:

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Wed Apr 07, 2004 1:33 pm

Code: Select all

edited and cutted
Never mind , I found my mistake ...

Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

mostafiz93
New poster
Posts: 31
Joined: Thu Nov 24, 2011 12:08 am

Re: 626 - Ecosystem

Post by mostafiz93 » Mon May 07, 2012 7:32 pm

I'm getting WA in this problem.
I used complete search to find all possible food chain and printed only the valid ones according to lexicographic order.
can anyone find any bug in my code?

Code: Select all

removed after AC

mostafiz93
New poster
Posts: 31
Joined: Thu Nov 24, 2011 12:08 am

Re: 626 - Ecosystem

Post by mostafiz93 » Mon May 07, 2012 9:14 pm

the algorithm was ok. got a rank within 20. :)

matheusdallrosa
New poster
Posts: 11
Joined: Fri Nov 08, 2013 11:04 pm

Re: 626 - Ecosystem

Post by matheusdallrosa » Sat Jan 10, 2015 9:40 pm

AFf the PDF format version has not the statement: Output a blank line after each test case.
But the HTML format has.

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 626 - Ecosystem

Post by uDebug » Fri Mar 13, 2015 8:07 am

Just to make things clear: Species can consume themselves. The judge's input has test cases like Observer shared. So make sure your code handles this.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Post Reply

Return to “Volume 6 (600-699)”