Page 1 of 1

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

Posted: Tue Jan 16, 2007 11:04 am
by serur
Hi fellows!

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


Posted: Tue Jan 16, 2007 6:18 pm
by Darko
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.

Posted: Tue Jan 16, 2007 7:57 pm
by serur
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

Posted: Tue Jan 16, 2007 8:41 pm
by serur
Btw, 10^5 != 10,000.
Oh, you fellas'll kill me one of these days :wink:

EDIT:
got it at last...

Posted: Tue Jan 16, 2007 9:04 pm
by Darko
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.

Posted: Tue Jan 16, 2007 10:08 pm
by serur
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.