could ne1 please point out why m i getting TLE for this solution: http://ideone.com/IQGYPO

and a WA for this solution: http://ideone.com/TZZjpd

1 Like

I don’t know about TLE but I can probably give you reasons for WA

  1. You don’t need to define a power function. pow() is a builtin function in Python.
  2. You should check if any of the l[i] is 1. If that is the case, the answer is 1 in any case.
  3. You are not taking modulus of v before passing it to the power function.

You can refer to my submission here

Kindly post your question on the editorial page of the respective problem here: http://discuss.codechef.com/questions/9733/junongf-editorial. You will get your answer to your query.