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

×

I'm getting SIGSEGV error in codechef, not in compiler

see the compiled code at http://ideone.com/gIWKI1

asked 16 Sep '14, 13:34

imah4ck3r's gravatar image

1★imah4ck3r
11
accept rate: 0%

edited 16 Sep '14, 16:24


state the problem which you are trying to solve !!

link

answered 18 Sep '14, 10:12

zargus's gravatar image

2★zargus
17662136
accept rate: 0%

(18 Sep '14, 10:33) indiantarget2★

you dont need the this loop in lines 31 and 48.

for(i=0;i<size;i++)

because of these for loops variable 'k' reaches a value of size*size where as you have allocated array 'b' only 'size' ints.
remove these for loops ideone link and you wont get any sigsev error but you will get tle(time limit exceeded).
see the editorial for faster algorithm.
a small suggestion try to write code with indentation as it will help you in reading code and debugging.

link

answered 19 Sep '14, 12:57

abhinav1234's gravatar image

4★abhinav1234
47045
accept rate: 40%

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:

×278
×13

question asked: 16 Sep '14, 13:34

question was seen: 492 times

last updated: 19 Sep '14, 12:57