For handling large numbers (so-called bigInt s ) we need to operate with them digit by digit like we used to do from our early grades. Sum up the last digits, if the result is greater than 9 then keep the "1 in mind" and write down 9 and after processing the next pair of digits add the 1 (if kept in mind from the previous step) and do the same for all the digits and save the result up in an array. Also you should use fast input/ output methods to makre sure that your code gets accepted.
No comments:
Post a Comment