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

×

Why is tis code giving SIGSEGV error although no array element is out of bounds?Plz help I am new to competitive coding.

https://www.codechef.com/viewsolution/18891776 It is from beginner practice questions(TRACE).

asked 13 Jun, 15:54

arron_tij's gravatar image

2★arron_tij
1
accept rate: 0%


Suppose n=100

So when you are calculating maximum trace at last iteration i=99 and k=98

Now i+k=197 which does not exist and thus the runtime error.

link

answered 13 Jun, 16:13

swapnil159's gravatar image

4★swapnil159
2365
accept rate: 19%

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:

×833

question asked: 13 Jun, 15:54

question was seen: 72 times

last updated: 13 Jun, 16:13