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


problem with the code in c++

i have done the chefmover problem with c++ but it is showing WA for one testcase .but when i submiit the same concept in python i got 100 points.can anybody find where i am missing. my c++ code my python code

asked 18 Aug '17, 20:43

manaranjanfav's gravatar image

accept rate: 0%

I think this must be because of overflow. Because it is given that range of Array A is 10^9 but you are taking the input of array in "int".

int arr[n]; // from your code.

Since python doesn't overflow easily, that can be one of possible reason.

Hope this helps!


answered 18 Aug '17, 20:52

sandeep_007's gravatar image

accept rate: 16%

got it .thank you


answered 18 Aug '17, 21:05

manaranjanfav's gravatar image

accept rate: 0%

your welcome brother, please accept the solution if you think it helped!

(18 Aug '17, 21:08) sandeep_0075★

yeah it got accepted after changing all variables to long long int

(18 Aug '17, 21:13) manaranjanfav4★

@manaranjanfav Sandeep meant that you mark his response as the answer to this question. You can hover onto this answer, you should see the accept answer option,

(18 Aug '17, 21:34) sun_d2★

sorry i accepted the answer

(18 Aug '17, 21:39) manaranjanfav4★
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: 18 Aug '17, 20:43

question was seen: 215 times

last updated: 18 Aug '17, 21:39