I don't know. I received credit for sinking a cargo ship in a harbor before. But I haven't done it enough to see why. I distinctly remember that it was still above the surface though.
In the real war, captains took shots plenty of time when it was very unlikely that they would receive credit for a sinking. The game was to damage the enemy and let the lousy scorekeepers fight over credit later. It was assumed (based on bitter experience) that even conclusive sinkings would be denied sometimes anyway, so why worry about it. Even damaging an enemy vessel put it out of service for a time, so was a worthwhile thing to do.
And it wasn't like there were more entertaining things to do anyway.
For a stationary target, range is not important in calculating the solution.