Is it easier to get into UCSD and UCD undeclared and then switch into CS if accepted?

Switching into CS at UCSD is extremely difficult and is now done by lottery so no guarantees. UCD would be a slightly easier switch but also not a guarantee.

https://cse.ucsd.edu/undergraduate/cse-capped-major-status

https://www.cs.ucdavis.edu/undergraduate/cs/change-of-major/

You have a solid SAT score and you would probably have a good chance at UC Santa Cruz or Riverside for a direct admit. Also as I have mentioned before with your GPA and SAT score, you would be competitive for many of the Cal States.

I would definitely apply widely to the UC and CSU system and then see where you end up getting accepted.