I found a good solution for the PALIN problem. I try this solution with very large data (about 1000000). Locally, it works fine, but after submitting solution to SPOJ, i`ve getting NZEC runtime error. I have no idea where come from this error. Pleeease help me.
My submitted solution number: 2350700