The correct answer is A:
When the flask is filled with water, the air supposed to be in the flask will be chased, then there will be no air and by the way no oxygen (or very few).
Anaerobic bacteria live in mediums which are deoxygenated (or like it was the case with the flask (there was no air and there were enough organic molecules to grow).