Many users have asked about the increasing rate of submissions being judged as "Submission Error" for no apparent reason. Even previously "Accepted" submissions are wrongly judged if sent again. In short, the problem is not in your code but in our side. If this ever happens to you, then please try a different problem to solve.
The problem behind this is a performance issue.We receive more than one million submissions every year and we need to store all of them. We take statistics on all the submissions ever received. On top of that, for every single submission we receive, we need to update all those statistics. The system we are currently using is not prepared to handle such a high load. For some specific problems, the judge loads the database (large datasets, high number of submissions.... The database responds by refusing the query. After some time, the judge doesn't know what to do and tags the submission as "Submission Error".
There is no easy trick around this problem. Some time ago we started building a new system but it's still in an early stage of development. It will take some time before we can fully use it (from 6 months to a few years depending on the time and support we get). At some point we'll open the development, so any of you who are interested on it can help us coding it.
In the meantime, you can use our site with the less demanding problems that the judge is able to judge. We are very sorry about this and we're working hard to develop the new system. Needless to say, all "Submission Errors" will be rejudged when the new system is active.