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

×

FIBONACCI STRING:- CODE NOT WORKING THOUGH CORRECT

I wrote this code for Fibonacci string problem(code-CLFIBD)

PROGRAM

I tried all the posibilities, but it is still giving SIGSEGV error on codechef. The code is working correctly on my ubuntu. Please help!!!

asked 02 Aug '18, 13:52

shreejeetsahay's gravatar image

0★shreejeetsahay
01
accept rate: 0%


You have declared char S[50] which is wrong since the length of string can be 1≤|S|≤10^5 as given in the question. Therefore in the test cases where length of string is greater than 50 your code cannot access that memory hence giving SIGSEGV error. Use char S[100001].

link

answered 02 Aug '18, 14:27

elli0t's gravatar image

4★elli0t
574
accept rate: 4%

Thank you!!! Quite new to codechef so this problem. Will remember it for sure.

(02 Aug '18, 20:03) shreejeetsahay0★
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:

×643
×137

question asked: 02 Aug '18, 13:52

question was seen: 113 times

last updated: 02 Aug '18, 20:03