3502, "The Mysterious X Network", MLE & RTE, n

Do you want to discuss about these problems? Go now!
Users are shared (no need to re-register).

Moderator: Board moderators

Post Reply
serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

3502, "The Mysterious X Network", MLE & RTE, n

Post by serur » Tue Jan 16, 2007 11:04 am

Hi fellows!

This code for 3502 Live Archive results in MLE.
Why it is so I can never make out.

Last edited by serur on Tue Jan 16, 2007 10:12 pm, edited 1 time in total.
If there is ever a war between men and machines, it is easy to guess who will start it (c) Arthur Clarke

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Tue Jan 16, 2007 6:18 pm

I downloaded the SWERC 2005 data by... well, googling for "SWERC 2005". It will be easier for you to debug that way.

Btw, 10^5 != 10,000.

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Tue Jan 16, 2007 7:57 pm

I like your way of thinking.
I was always thinking why LiveArchive Board is so inactive (why, there are ever so many rubrics with no posts in them!).
However, SWERC 2005 Data is 12Mb, what on earth they have packed there - I haven't the slightest idea
If there is ever a war between men and machines, it is easy to guess who will start it (c) Arthur Clarke

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Tue Jan 16, 2007 8:41 pm

Btw, 10^5 != 10,000.
Oh, you fellas'll kill me one of these days :wink:

EDIT:
got it at last...
Last edited by serur on Tue Jan 16, 2007 10:03 pm, edited 1 time in total.
If there is ever a war between men and machines, it is easy to guess who will start it (c) Arthur Clarke

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko » Tue Jan 16, 2007 9:04 pm

Well, I was going to post a response a week or two ago day, but you removed your post. I see it's there again (with the changed code, I guess).

I checked my Java code and there is nothing special, read graph, do BFS.

With 10^5, nodes can't fit in 2 bytes (I assume short is 2 bytes), that's where the RTE's are happening. I couldn't follow that code because I don't know C enough, stuff like "u = *head++;" just throws me off.
I have no idea why you would be getting MLE, my Java submission uses 13MB.

serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

Post by serur » Tue Jan 16, 2007 10:08 pm

Hi Darko.

I've downloaded that 12Mb, made a python program that complies and executes my code with that cases, and now it's ok.
You're right, USHORT_MAX == (1 << 32)-1,
so 100,000 (btw, you gave me a striking piece of information: 10^5 != 10^4)
was not going to fit in short by no means.
Also, my AC-code isn't fast enough - 1,438 CPU - but it takes ~6000 memory.
If there is ever a war between men and machines, it is easy to guess who will start it (c) Arthur Clarke

Post Reply

Return to “ACM ICPC Archive Board”