I haven't purchased any bad cars, so the worst wasn't bad, but I'd say my 2010 Prius that I bought with 150,000 miles on it was the worst of the ones I've had.
I calculated the total cost of ownership for that Prius (including everything - maintenance, repairs DIY as well as shop, gas, insurance, depreciation, etc.) for that Prius over the 3 years that I had it was only 17 cents per mile, which is pretty great. I did dodge a bullet with it though, because high mileage third generation Priuses can have head gasket issues, and a $2500 hybrid battery pack was an expense that I knew was coming within about 5 years when it was totaled in a caribou collision. Insurance payout was about what I paid for the car.
The better cars that I own or have owned are Subarus: '94 Loyale wagon, '96 Legacy wagon (current beater that I've owned since 2000), and '03 Legacy L Special Edition wagon (my "new" car, kept in almost time capsule-like condition with some patina, perfectly maintained, rust-free, and plan to keep it forever).