You are not logged in. Please login at www.codechef.com 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 https://www.codechef.com/viewsolution/14951850 my python code https://www.codechef.com/viewsolution/14951721

asked 18 Aug '17, 20:43

manaranjanfav's gravatar image

4★manaranjanfav
235
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!

link

answered 18 Aug '17, 20:52

sandeep_007's gravatar image

4★sandeep_007
7827
accept rate: 15%

got it .thank you

link

answered 18 Aug '17, 21:05

manaranjanfav's gravatar image

4★manaranjanfav
235
accept rate: 0%

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

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

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_d3★

sorry i accepted the answer

(18 Aug '17, 21:39) manaranjanfav4★
toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×587
×239
×7

question asked: 18 Aug '17, 20:43

question was seen: 183 times

last updated: 18 Aug '17, 21:39