But do you need to ignore the exception? Can’t you re-throw it? or throw another? At least then you’d know something was not as you expected.
Length of all words <10^6 tells you how many trie elements you need.
The output format looks ok to me. Are you removing the line feed after the final test case? There’s no need to.
After removing return, spoj did give a nzec. I will try to see why now. Can it be related to heap space for java. I also removed the extra list of words that i had introduced for devugging . It did reduce the memory consumption 10 times but still runtime error (NZEC) .
But in other questions this has happened too when I used this method of i/o . And after just returning , i used to get AC. Like CSTreet and other questions. Still I will try some far fetched test cases.
Well, you said:
so I suspected that there may be some words longer that the 64 byte buffer allocated in readline. But. I’ve now discovered there aren’t any long words. Whatever the problem is in readline, it’s not caused by words longer than 64 characters.
What makes you sure readline is the culprit?