Problem statement:
An equilibrium index of an array is an index into the array such that the sum of elements at lower indices is equal to the sum o
The short answer is that ultimately it can't be completely cured/solved, unless you limit the number/magnitude of the inputs--not even with something like Java's BigInt (or equivalents for C++ such as gmp, NTL, etc.)
The problem is pretty simple: the memory in any computer is finite. There will always be some finite limit on the numbers we can represent. An arbitrary precision integer type can increase the limit to numbers far larger than most of use work with on a regular basis, but regardless of what the limit might be, there will always be dramatically larger numbers that can't be represented (at least without changing to some other representation--but if we're going to have precision to the units place for arbitrary numbers, there are distinct limits on how clever we can get in representing gargantuan numbers).
For the conditions given in the linked problem, the long long
type in C and C++ is adequate. If we want to increase the limit to some ridiculous size with a solution in C++, it's pretty simple. Although they're not a required part of a C++ implementation, there are many arbitrary precision integer libraries available for C++.
I suppose there could be some way to compute an answer to this problem that doesn't involve actually summing the numbers--but at least at first glance, this idea doesn't seem very promising to me. The statement of the problem is specifically about computing sums. While you could certainly carry out various machinations to keep the summing from looking like summing, the fact is that the basic statement of the problem involves sums, which tends to suggest that solutions that don't involve sums may well be difficult to find.