https://www.codechef.com/viewsolution/28166150
I think every think everything is all right…
What is the largest value of N that can be provided as input?
1 Like
1 ≤ N < 10^5
I changed my approach by using strings which qualified all the constraints and got the answer right but I want to know what changes you would have made in the code (link above) to get answer right ie >>1 ≤ N < 10^5 by using int ???
1 Like
I’d simply use string
s - 10^{100000} is far too big to fit into any built-in datatype. string
is perfect for this question as there is no arithmetic involved, and all we care about is the value of each digit, which is easily obtained from a string
2 Likes
thanks for replying my posts every time:grinning:
1 Like