Tuesday, August 19, 2014

COJ 1293. Powers of Two

It is easy to understand that the answer will not fit into long long integer. So we need to deal with them considering them digit by digit -> we need to keep an array where every element will be only 1 digit of the entire number. Initially it will represent 2^0 which is 1. Then we need to loop over it N times and do the multiply by 2 part carefully Check the source code for a good understanding


       FULL SOURCE CODE

No comments:

Post a Comment