Thanks for your detailed and convincing investigation, I run your solution just one time, because it is a contest problem, it needs to be very safe to get AC due to the time penalty. I do agree it is the judge's fault, clearly it is a bit same as last contest, I think they didn't test python solution very well.