Frustration Overloaded! -_-

It was a warm sunny day. Birds chirping, gentle wind blowing. After attending two very boring classes, finally I got a chance to solve a hilariously simple question Bank Robbery. Which apparently took a complete day to crack. It turns out that the corner case which I was praising myself for taking into consideration (p=0) ,apparently costed me over 20 WAs and two CE. In the process I learned how to efficiently code in Python 😛 and a problem involving mismatch of input and output buffer streams due to wrong use of “ios::sync_with_iostream(0)” i.e using cout/cin and printf/scanf in the code which de-synchronized I/O buffers.

Correct CPP solution

Wrong CPP solution

Correct Python solution

Wrong Python solution

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s