You are not logged in. Please login at to post your questions!


Wrong answer in SPOJ HORRIBLE

Everything seems fine to me,still am getting WA..Can someone help ? My code :

asked 28 Jun '16, 14:59

sandeep9's gravatar image

accept rate: 4%

Just change val from int to long long in update_tree function. You will get AC. Hope it helps !!


answered 28 Jun '16, 18:53

torque's gravatar image

accept rate: 17%

Thanks for the help,but the constraint says that val <= 10^7...Then why do we need to change val from int to long long int ?

(28 Jun '16, 19:27) sandeep93★

val is greater than 10^7 in test files most probably. Many SPOJ problems have such issues. Do check the comments on that problem because people generally put such issues there and make others aware.

(28 Jun '16, 20:08) torque6★

oh thanks.. will take care of it in future

(28 Jun '16, 20:36) sandeep93★

v<=10^7 and size of array<=10^5. So query will give result<=10^12(doesn't fit in int).

(28 Jun '16, 22:27) dushsingh19954★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 28 Jun '16, 14:59

question was seen: 530 times

last updated: 28 Jun '16, 22:27