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


Kayaks - Runtime Error C++

I tried my best to optimize it. But, it still shows runtime error. Please help.

My Code Link:

asked 14 Jun '12, 11:45

vaibhav6980's gravatar image

accept rate: 0%

edited 25 Jun '12, 13:01

admin's gravatar image

0★admin ♦♦

You don't need optimizations to get rid of the current error. You are getting a Rumtime error SIGSEGV. See the reasons why you could get a SIGSEGV

        cin>>a[i][1];//w    Strength

In the lines above you are accessing the array elements a[i][0], a[i][1] and i could be as large as n and n<=10^5. But your array declaration is just a[10][3] hence you will end up making some invalid memory access after i crosses 10 resulting in a SIGSEGV.


answered 14 Jun '12, 12:01

gultus's gravatar image

4★gultus ♦
accept rate: 51%

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: 14 Jun '12, 11:45

question was seen: 1,471 times

last updated: 25 Jun '12, 13:01