I am not a Pennsylvania Lawyer, but the terms of your lease will control. You need to take out the lease and look to see what the contract says about early termination. Many leases will allow that on 30 or 60 days notice, but you will be responsible for the rent for the term. If there is not clause in the lease that addresses early termination your state may have a uniform act that applies.
Your lease is the first place to look to see what the terms are to terminate your lease. If you only have to give 30 days notice then give the notice, stay for the rest of the month, then when you move out you should get your security deposit back. The statements your landlord made are conflicting. First, if the lease is for one year, how much time is left on the lease. If the lease is only a month-to-month lease then the advertising is excessive. But, when you break a lease the landlord can hold you to the entire lease period or until the property is re-rented. So consider how much time is left on your lease when considering getting out of it. if there is a long period left then the loss of the security deposit and a couple hundred dollars for advertising may be a good deal.
I want to add something to the answers by the other lawyers. You can sue your roommate at the District Magistrate's office for the rent and other costs you must pay in his/her behalf, whether or not he or she has moved out.
There is nothing in Pennsylvania law that permits you to breach your contract with your landlord. However, you both may be mistaken as to what the contract says. Talk to a lawyer before you take action.