Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

What's Wrong in following Program

0 votes
asked Feb 24, 2019 by anonymous
result = 0
  GP_sum = K # Handling p = 1 case separately.
  mod = 1000000007
  for(x in 1 to N) {
    if x != 1
      GP_sum = GP_sum + (pow(x, K+1)-1) * pow(x-1, mod-2) # Multipyting by inverse modulo of x-1.
      GP_sum %= mod

    result = result + GP_sum * A[x]
    result %= mod
  }

1 Answer

0 votes
answered Feb 28, 2019 by Noah DeBord (310 points)
No periods, needs semi colons for the statement as well.
commented Feb 28, 2019 by Noah DeBord (310 points)
statements***
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...