MULARR - Editorial

PROBLEM LINK:

Practice

Contest

Author: Akshay Venkataramani

Tester: Timothy Jeyadoss

DIFFICULTY:

Cakewalk

PREREQUISITES:

Arrays

EXPLANATION:

Simply find the product of the array. NOTE: Use long long int for all calculations. Integer variables are 32 bit, and can only calculate values precisely upto 10^9. Post that, long long int needs to be used(64 bit) for all calculations.

The constraints were N<=10 and A[i]<=15, resulting in a maximum possible product of 15^10, which is greater than 10^12.

AUTHOR’S SOLUTION:

Author’s solution can be found here