This is for those people who are using Java to solve the problems in Valladolid.
I have some time practicing in this site and i have found some things that i think are very useful for begginers.
Here programming in Java we already know is very limitated, classes like TreeSet, BigInteger, Line2D, TreeMap, Arrays are not supported so mucho of the code that i have not to implement in a ACM ICPC contest i have to do it here because of this little problem.
Now this is in process of been solved because Valladolid is going to upgrade the Java Compiler (HUUUUURRRA
![:D](./images/smilies/icon_biggrin.gif)
![:lol:](./images/smilies/icon_lol.gif)
The main problem that have to be solved is the ReadLn method that is proportionated in the judge page or the test cases that are not coherent with THAT ReadLn proportionated.
Let me explain you the problem with this ReadLn().
Suppose you have a Input file where the End of File is EOF and the input is like this
1
2
3
4
EOF
In this input file your Java Program should work without problem. This is (I hope) the majority of cases here.
But suppose that your File is like this
1
2
3
4EOF
This is not going to work in your Java Program because the last case never is going to be processed with you program. The ReadLn ignore the line with EOF independiently of the content before the EOF. I have seen some problems with a Input file like the last one so be careful and try to upgrade the ReadLn proportionated here to solve this kind of problem.
Another problem that happens, but is rarely seen (at least for me) but i have to be honest and say that i have not put any effort to detect this kind of problems if an input file like this
1
2
3
4
EOF
As you see there is an empty line between the line 2 and three. This is not hard to deal with it. But if the problem does not say anything about empty lines why enlarge your code with this checking. This problems are very annoyng because Pascal, C, C++ eats all the spaces and this is unnoticed but in Java not. So the problemsetters have to be very careful when they are writing the input data.
I write about the last example because if you see that a problem nobody has solved with Java and the algorithm that you consider correct get WA try to deal with empty lines (maybe this is your problem, or i should say the problemsetter problem) .
I would like to know if you find this kind of problems and the problems because i dont want to lose time trying to fix a correct program.
I hope this little advice about some common Java Problems here coud help u.
PD: Be careful with problems 10055 to 10063 some of them have problems of this kind I dont remember which one. But you are alerted.