Cancel AP score?

I’m taking AP computer science right now and I’ll have my exam tomorrow. I am certain with no doubt that I will get a 1. I unluckily have the worst teacher on campus to teach the subject and since he doesn’t even care about the class, I and most of the class have an A. Will it look bad if I get an A in a class, yet get a 1 on the exam? Will that in any way undermine the A I received? thank you

Yes. It counts as grade inflation. You get a grade, but are taught little to no material.