10 / 10
Dec 2006

Is there anyway I can get the error message from my submission attempt? Because my submission works fine on my machine but doesn't with SPOJ.

I'm using haskell with ghc-6.6 on my machine, but I see no reason why my program shouldn't work with ghc-6.4.

I'm attempting the ABWORDS problem, if that information is needed, same username there as this one.

Your program prints to stdout:
"Prelude.read: no parse"

(I don't have an idea what that means)

Hmm, strange. It means that a routine that converts a string to an int didn't receive a string that could be parsed as an int. I was using it for reading in the number of test cases and the number of elements in each set. Could you check for me that the input did in fact begin with a number? Because if the input looked like this:

1
3
abab..
...
...

then it should be fine.

Also, that was a nice, fast response. Do you hang around here all day? smile

It seems ok..
But the number of sets isn't 1, of course.
Data sets are separated by empty lines (as stated in the problem desc.), maybe that's the problem?

I have a habit of refreshing the forum page when I ought to be working wink

That was exactly the problem. Thanks very much for your help smile Now I'll probably get a TLE but at least it will make sense smile

Hi,

Can't figure out what's causing the NZEC error for my program, which runs fine here. Could you please include actual error messages in the email responses also? NZEC means diddly squat frowning

Solution #585167

Jonathan

Fatal error: exception Invalid_argument("index out of bounds")

No, we simply can't.
It's impossible to say what is an error message and what is the program copying test data to stderr.

[quote="noix"]
It is:

Fatal error: exception Invalid_argument("index out of bounds")

[/quote]

I saw in another forum thread that you use -unsafe option to ocamlopt. Is this no longer the case?

[quote="purevoid"][quote="noix"]
It is:

Fatal error: exception Invalid_argument("index out of bounds")

[/quote]

I saw in another forum thread that you use -unsafe option to ocamlopt. Is this no longer the case?[/quote]
It is.
It is compiled with "-unsafe" and linked with str.cmxa and nums.cmxa.

That's seriously a WTF then. The only functions that raise that exception are string and array get/set, and it's compiled with unsafe, which turns those off. Also, I can't reproduce at all with unsafe turned on for ocamlopt, even after installing 3.08.1 on my system.

I've submitted a version that explicitly uses String.unsafe_get, which in my mind proves that the -unsafe flag isn't being passed/picked up correctly for some reason.