What happens if I fail Calculus AB but ace Calculus BC?

Lets say I get a 2 on AB AP Exam but I get a 4 or a 5 on BC AP Exam.

Do I only get credit for Calculus 2 or can the colleges figure out that since I aced BC, I should be credited for Calculus 1 also?

BC has an AB subscore.

Credit decisions rest with the individual colleges, but if a college gives credit for both Calc 1 and Calc 2 based on the BC exam, they will not care what your score was on the AB exam.