It is the same ship. It is being valued in precisely the same way, thus it responds to its environment in precisely the same way. Its components are equal to each other as this A is equal to this A, and this you to this you.
The same question and answer can be applied to a human or any living body. Both the context and the components change - but the Idea of it remains. The executed functionality of the ship, the glue between its abstract existence in the minds of the men and its becoming along with the men and the sea, this is also what drives us to do what we do, and for all intents and purpose defines us.
That is to say that when Theseus decides to use a plank from the ship to pierce a monsters eye, it is no longer the same ship.