Problem : https://www.codechef.com/LTIME66B/problems/MXM My Solution : https://www.codechef.com/viewsolution/21692278 Working well with most of my Testcases ; Please help ! asked 24 Nov '18, 22:39

It does not work for the following simple test case:
Your code generates 3, while it should be 4.
The code has multitude of problems, starting with
1. You define array numbers[n+1] at the moment when n is not properly initialized yet.
2. You store values of powers of p in char which is limited by 127.
What's the most interesting is that your code is still able to solve some of the test cases. answered 24 Nov '18, 23:54
@oleg_b Thank You ! Even 'long long int' won't work for storing the values of the (integer)^(power) , Please correct me if I am wrong ?
(25 Nov '18, 07:14)
Yes, 'long long int' does not have sufficient capacity. The approach should be quite different  you need to represent the numbers in the base of k. For example, if k is 10, then 10^100 is a vector with 101 elements, all of them are zeros, except the last one which is 1.
(25 Nov '18, 17:24)
