Here is my code to the question
Please help me to find the fault in my code. asked 04 Sep '17, 22:11

n in range of upto ${10}^{5}$ is bound to give you overflow (and hence WA) in Read up fast exponentiation, or store the power of 2%mod in an array and use accordingly. answered 04 Sep '17, 23:23
@vijju123 In the question there is a line that say: Since the answer can be very large, print the answer modulo 10∆9 + 7. What does it mean.
(05 Sep '17, 14:15)
It means that answer can be as large as ${2}^{100000}$ . Since we cannot store such numbers in conventional data types, we take remainder of the number when divided by ${10}^{9}+7$. Read about properties of
(05 Sep '17, 15:52)
@vijju123 But it is showing wrong answer even for subtask n<10
(05 Sep '17, 19:00)
cause ${A_i}$ is ${10}^{9}$ even for smaller subtask
(05 Sep '17, 19:22)
@vijju123 can you please guide me how should i update my code to get it solved.I have tried some changes but its still showing wrong answer.
(05 Sep '17, 22:23)
Its best to look at editorialist's solution first, because I havent attempted the question yet. If a doubt persists after that, I will happily help :)
(05 Sep '17, 22:43)
showing 5 of 6
show all
