Dear Catherine,
Honestly, I'd suggest removing the carpet completely. Indoor outdoor carpet is almost always treated with long-lasting pesticides, and will remain. The amount of mold growth from a week's worth of standing water would be worrisome, too, and I wonder if anything would ever get it all out. Assuming there is adequate ventilation in the basement, after removing the carpet I'd suggest spraying the floor with straight household vinegar and not rinsing. Let it set for few days. Then scrub the floor with a thick borax paste and let it dry. Once thoroughly dry vacuum and sweep up, and then rinse thoroughly (this will be a job!). At that point I'd consider a new type of flooring, but one that does not contain pesticides or other chemicals of concern. Good luck, and my sympathies!
Annie