Broken calculator

Why TestCase 0 is giving run error ?

Change line 25 to long long int res[100000]; and then check.