Java Compiler is FLAWED!!
Posted: Fri Aug 15, 2003 5:24 pm
I know that the java compiler the OJ is using is flawed.
I solved question 112 using java, and submitted it. I checked it against all test inputs, and compared output to an accepted program I have. Everything was the same, but I still got WA.
I tried every possible input, created an input generator and tested my program with 10000 inputs. My Java program matched the accepted one perfectly.
Yet still I got WA.
So I translated my Java program to C++, keeping the logic exactly the same. Again I tested the programs. This time, all the versions matched output (C++ accepted version, Java WA version, and C++ translated version). When I submitted my C++ file, it got accepted.
Given that my program was only about 70 lines, I know I translated it to C++ perfectly.
Also, to be noted, I compiled my JAVA file using gcj 2.96 (which is newer than the version used here) and ran the binary against all my test inputs and it matched perfectly.
So that's how I know the java compiler here is flawed. Users beware...!!
I haven't been able to find an older copy of gcj to try my program with it.
Also, this happened to me with SCUD BUSTERS. I rewrote my rejected program in C++ and it got accepted.
I solved question 112 using java, and submitted it. I checked it against all test inputs, and compared output to an accepted program I have. Everything was the same, but I still got WA.
I tried every possible input, created an input generator and tested my program with 10000 inputs. My Java program matched the accepted one perfectly.
Yet still I got WA.
So I translated my Java program to C++, keeping the logic exactly the same. Again I tested the programs. This time, all the versions matched output (C++ accepted version, Java WA version, and C++ translated version). When I submitted my C++ file, it got accepted.
Given that my program was only about 70 lines, I know I translated it to C++ perfectly.
Also, to be noted, I compiled my JAVA file using gcj 2.96 (which is newer than the version used here) and ran the binary against all my test inputs and it matched perfectly.
So that's how I know the java compiler here is flawed. Users beware...!!
I haven't been able to find an older copy of gcj to try my program with it.

Also, this happened to me with SCUD BUSTERS. I rewrote my rejected program in C++ and it got accepted.