Do I still have a chance of transferring to UCB,UCLA, or UCSD? (computer science major)

With a D in both math and history, it’s going to be a problem. Can you retake?