Messi_GOAT's blog

By Messi_GOAT, history, 4 years ago, In English

This is the problem link here is my code.

  • Vote: I like it
  • -18
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it +4 Vote: I do not like it

NO constraints on the elements of array are given.

Since normal summation is giving wa so it may happen that elements are greater than long long limit.

so use addition like we did in school(carry method) or use big integer.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The answer does fit in long long. Your problem is that you should keep taking input until EOF not only 1 testcase. https://ideone.com/jkCnqF got AC.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    oh shit, EOF was the main problem, how can I know which problem i should use EOF?

    • »
      »
      »
      4 years ago, # ^ |
      Rev. 2   Vote: I like it 0 Vote: I do not like it

      The input section mentioned "every testcase" which implies the possibility of having more than 1 testcase.