The first thing you need to find out is what is actually underneath the carpet, is it underlay or vinyl or even concrete, after a flood of any meaninful size, the first thing you must do is ensure that all water is actually removed, if you don't, you will recieve a call back because of the smell!
Depending on the size of the problem, you could find yourself, removing the carpet and any underlay, cleaning and sanitising the hard floor surface, replacing or cleaning the underlay if present, then re-laying the carpet and finally cleaning the carpet, goes without saying that all cleaned materials should be dried slowly to avoid shrinking, best of luck!