Hey. I’m in the exact same boat as you are.
I took the midterm today too and I’m pretty sure I failed horribly. I sat in the front, I studied for weeks too, every night and made sure I remembered everything. I was so mad at myself today that I also wanted to cry deep down. I feel beyond stupid too. But I’m sure you’re not stupid, you’re giving yourself less credit. I’m sure you did okay, at least...

First off, it sounds like you might have depression and maybe anxiety. I’m no doctor but the fact you say “all I can feel is guilt” and that you cry every night is very concerning. I’m honestly worried for you. It doesn’t sound normal. Have you ever been medically diagnosed/seen a doctor or therapist? I have depression and what you said really seems like it. Maybe it’s been difficult to retain info because you’ve been feeling so awful about yourself.

Computer science in general is a very difficult major. I’m struggling in it, a lot of my friends and people I know from my lab, discrete math courses are also having some trouble. You’re not alone. You can PM me if you need to. -Vivi