Aaand I tried putting that number as an argument into readlines(), and it didn't work.
>>> help(f.readlines)
Help on built-in function readlines:
readlines(hint=-1, /) method of _io.TextIOWrapper instance
Return a list of lines from the stream.
hint can be specified to control the number of lines read: no more
lines will be read if the total size (in bytes/characters) of all
lines so far exceeds hint.
Okay, so I've concluded that I suck at this. I was super close to getting problem B. Then I realized I spent an hour on one approach when I could have done it in 10 minutes max with a far simpler and more obvious approach. I'm an idiot >_<
@Doorknob You're not an idiot. Sometimes the obvious approach isn't at all obvious at first, especially under pressure. You did great in my book regardless.
@Doorknob If it's any consolation, when I found out that only 1000 people advance past this round, I decided not to try at all. So the fact that you tried at all means you did better than I did. :P