Hello all,
I have tried to use Java for all problems and these are the things that annoy me personally:
- why let us be able to read one character from stdin (System.in.read()) but not a whole line with useful and completely normal tools like a BufferedReader? You tell me, cause I don't understand...
- exceptions always give a WA instead of RTE. I also compete in ACM regional contests (not the ones online) and they all use a judge system where exceptions give RTE's. So is this really impossible to establish?? Right now I always have to check first wether a WA really means WA or RTE, with a try{} catch {} statement. And when I find out that it's an exception that's occuring, I have find out myself what kind of exception this might be (also possible with more try-catch-statements). This costs time and a lot of submisions! Really...
- sometimes when my code gets a bit complicated the judge compiler gives me Internal Compile errors (gcj: Internal compiler error: program jc1 got fatal signal 11). After a LOT of time and effort, I'm now convinced that usually this happens when I use too many dereferences (I mean dots). For example, a statement like
- Code: Select all
graph.node[i].edge[graph.node[i].neighbours].end = 4;
could give this internal compile error while
- Code: Select all
Node n = graph.node[i];
n.edge[n.neighbours].end = 4;
does not. But you have to find out yourself where the judge compiler gets confused, without clues. Very annoying!
- why use JDK 1.1? Come on, if C++ users can have STL then let us use SDK 1.4. Very basic datastructures like a LinkedList, ArrayList, TreeMap and very basic tools for sorting and formatting of numberes we all have to implement ourselves or do without. What's wrong with a little up-to-date SDK? Now I can't even use a StringBuffer normally cause there's no deleteCharAt() method.
- and I always have trouble with problems where doubles have to be rounded. Also the DecimalFormat class is unavailable, so I have written my own round function. The problem is that my round-fucntion works perfectly, but the C printf("%.3lf") method does not! I've tested this very thoroughly and the printf method is inconsistent in rounding. For example, 19.005 could be rounded up to 19.01 while 20.005 could be rounded to 20.00 (and these are exactly the cases where my round function and printf could disagree). There are multiple problems where converting my code to C++ gave AC where as my Java program gave WA.
- as for time limits, most problems are OK and java programs get AC within time as well. But there are some problems (for example Erdos Numbers, Pascal Sorting Program...) where the input or output is huge and it's nearly or totally impossible to even read and StringTokenize the input before starting to work on the solution without getting a TLE. A little attention to the slow reading and writing of data of Java couldn't do any harm in my opinion...
Concluding, I regret to see that C++ users have all the advantages and Java users all the disadvantages while it doesn't have to be that way. Updating to SDK1.4 would be a great improvement.
Erik