MSNG why failed for initial constraints

https://www.codechef.com/viewsolution/27364975

Can anyone please tell me why this code didn’t pass the initial constraints?

Language: Java

Hey, its is not guaranteed that the number generated from a given base and the string y, will always be <= 10^12, and it also may be the case that the number generated can not be stored in long data type also, because 36^40 > 2^64(limit of long long in c++).

1 Like

Thanks a lot!
Will definitely keep this in mind here on.