Yep, time to replace it.
Did your apartment flood b/c of Mother Nature or something outof your control?- call management- tell them what you've done to try to take care of the problem and that the smell isn't going away, and that the carpet (and pad!!) needs replaced.
If the flooding is your own doing (bad waterbed mattress, broken fish tank, etc), call management, tell them all of the above, and ask how much it will cost to get the carpet and pad replaced. See if it can be paid in installments tacked onto your rent.... They may even let you pick the new carpet!
In the meantime-
1) Try some baking soda- it's pretty good at absorbing odors. I use it to take care of dog "accidents" when they happen on my carpet. Sprinkle it on the carpet and let it sit for a while- depending on how wet the carpet is... then vacuum. Just don't walk on the bakingsoda before you vacuum- it can pack into the carpet and just make things worse.
2) Another idea- run your AC all day to dry the air (and the carpet) or set a fan on the floor to dry things out.