Page 1 of 1

Live Archive flaw in input

Posted: Tue Oct 12, 2004 1:28 pm
by Maniac
I'm very confident that there is a flaw in the input of problem 2934 Who's the boss of the Live Archive (the problem is part of NWERC 2003 regional). The problem states this
Then there are q lines listing queries. Each query is a single legal employee ID.
But after many trials I found that there are test cases with queries where this is not the case (the employee ID in the query doesn't match the ID of any given employee).

Does anyone know how I should handle these queries? Or maybe an admin could check the input?

Thanks, Erik

P.S. sorry for posting here, but the Live Archive Board does not contain a section for the NWERC 2003 regional :-(

Posted: Wed Oct 13, 2004 3:08 pm
by Maniac
:evil: :oops:
Turns out that there's nothing wrong with the input, but with the Java compiler (again). I changed
[java]employee[i+1] = new Employee(nextInt(), nextInt(), nextInt());[/java]
into
[java]int a = nextInt();
int b = nextInt();
int c = nextInt();
employee[i+1] = new Employee(a,b,c);[/java]
and got AC.

Apparently the Judge's Java compiler doesn't evaluate the upper expression in the right order cause the result Employee was all mixed up (and didn't meet the problem description restrictions anymore). This issue also turned another long standing WA into AC! Java users beware....

Posted: Fri Oct 15, 2004 11:03 am
by Dominik Michniewski
I 'm not sure, but your first line can be evaluated in many different ways ... I don't know specification of Java so good, but I think, that behaviour of such code could be strange, as you noticed ;-)

Best regards
DM

Posted: Fri Oct 15, 2004 12:32 pm
by Maniac
So I did :-)
But I'm sure that the Java 1.4 compilers and newer ones evaluate the expression in the 'expected' order, i.e. the parameters in left to right order.