Sunday, May 20, 2012

TC SRM 541

Another bad performance, failed 250 and get a score of 0.

One thing to learn:

When you need to do 1<<shift, it will overflow silently. You can write 1LL<<shift but it is easy to forget put LL after 1. The way to do it?

long long val=1;
while(val < cap) val<<=1;

No comments:

Post a Comment