During my first semester, I participated in my university's IUPC selection contest.
There was one problem that looked easy. I came up with the solution quickly and submitted.
WA. "No problem," I thought. Submitted again. WA. Again. WA.
At some point, I wasn't solving the problem anymore. I was farming penalties.
After 20+ submissions, I finally found the culprit:
(int)
The problem needed: (long long) That's it. My algorithm was fine. My observations were fine. My confidence was definitely not fine.
That day I learned an important lesson: In competitive programming, the hardest bug isn't always in the logic. Sometimes it's hiding inside four innocent-looking letters:
(int)







