if you reach the target you should be at dist 0 and thus can at worst have a tie, it might be a bug if you lost