Got a C in a sophomore subject unrelated to my desired major... how does this affect Ivy/Oxbridge chances?

“C” in any academic subject is not going to be at all beneficial for your chances at Harvard or Yale. “C” in CS is particularly unhelpful if you express interest in economics as Econ at H and Y increasingly uses coding packages like STATA in advanced classes and for honors/senior thesis projects.