Somebody Can you explain me why?? 8)
created
last reply
- 11
replies
- 501
views
- 11
users
Somebody Can you explain me why?? 8)
Any Exception of the Java Virtual Machine will cause RE NZEC. This includes, but is not limited to, uncaught exceptions thrown by your classes and standard classes (including class/method reflection), and critical errors of various elements of the JVM (e.g. out-of-memory error, out-of-stack-space error, cannot-write-to-file error, cannot-find-startup-class error, all sorts of garbage collector errors). Try not to access weird elements of the SUN Java environment (e.g. locale files, time zone information, graphics), as these are not guaranteed to work.
I never wrote that standard java classes didn't throw exceptions. In fact, I wrote quite clearly that they do. For instance, the method Integer.parseInt throws an exception if you try to read in something of excessive size.
Just in case this was not meant as a joke, I'll answer: if testing programs in your editor were sufficient proof of their correctness, whyever would you want to submit them to an online judge? 8)
You are right Adrian, I express myself wrongly... you mentioned weird elements..... anyway.. I should have say "I didnt use anything weird, I didnt access anything weird, like a file or something"
How come NZEC are cause by exceptions? if my program test it and it works? how can I check what's wrong then? probably submited in another language wouldnt make so many problems and the time limit would be just perfect....
Catching the exceptions would at least avoid the NZEC. But it seems you are not expecting that your program throws exceptions if everything works like expected. So you should search for bugs in your program which could cause an exception (probably especially in the input reading part).
Using something that is not inside java.lang or java.util does not lead to exceptions. I successfully used java.math for example, and I think generally everything that you need for an acm problem is supported.
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
Strategies for Tackling Java-Based SPOJ Problems More Efficiently? | JAVA based languages | 0 | 65 | May 23 |