Replacing drywall on ceiling after a small flood
I usually remove sheets that have buckled and any wet insulation then put fans up to dry things out. Once dry I cut out past the worst damage to fit full sheets or 1/2 sheets. So no you don’t have to or even need to replace it all in some cases a 1/2 sheet will be enough others 2-3 sheets but it is rare even with a big flood the entire ceiling needs to be replaced normally 1 joist bay and bad floods the bay on either side, once the first bay comes down usually the water dose drain go further in the ceiling.
You do need to make sure to run fans to dry it out but if it has not sagged and you get it dry just patch the bad areas. Tape and texture then repaint.
I have purchased a home for my family that had this exact issue unoccupied I put fans in the room and a dehumidifier once things were dry I put the Sheetrock back up and we had no problems with mold I owned the house for about a decade after that.