SIGSEGV error

I want to ask that what should I do to remove this error but it is also working in my compiler and also in my debugger and please tell me about this error
and my code is:

#include<iostream>
#include<cmath>
#include<windows.h>
#include<stdio.h>
#include<cstring>
using namespace std;
 struct forest
{
int number;
int cost;
string ch;
forest *link;
 }*a,*b,*start;
 int main()
{
int q,z,total=0;
 int *g;
int n,in,i,m=0;
char sk[10];
string s[40]=      {"Alizarin","Amber","Amethyst","Apricot","Aqua","Aquamarine","Asparagus","Auburn","Azure","Beige""Bistre","Black","Blue","Blue Green","Blue Violet","Bondi Blue","Brass","Bronze","Brown","Buff","Burgundy","Burnt Orange","Burnt Sienna","Burnt Umber","Camouflage Green","Caput Mortuum","Cardinal","Carmine","Carrot orange","Celadon","Cerise","Cerulean","Champagne","Charcoal","Chartreuse","Cherry Blossom Pink","Chestnut","Chocolate","Cinnabar","Cinnamon"};
int w[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173};
cout<<"Enter the no. of ballons u have:";
cin>>n;
if(n>=1&&n<=40)
{
a=new forest;
start=a;
int h=1;
for(i=0;i<n;i++)
{
a->number=h;
a->ch=s[m];
a->cost=w[m];
b=new forest;
a->link=b;
a=b;
h++;
m++;
}
b->link=NULL;
b=start;
while(b->link!=NULL)
{
	cout<<"\t\t"<<b->ch<<"    "<<"$"<<b->cost<<endl;
	b=b->link;
}
int f;
cout<<"How amny color combinations u Want";
cin>>f;
g=new int[n*f];
cout<<"Enter your choice for selecting the pattern";

for(int p=0;p<n*f;p++)
{
	cin>>g[p];
}
	
for(int p=0;p<n*f;p++)
{
	b=start;
while(b->number!=g[p])
{
	b=b->link;

}
q=b->cost;
total=total+q;
}
}
cout<<"Expected cost for the bill is:"<<"$"<<total;
  getchar();
  return 0;
  }

Judging from your profile i assume you are solving the question LEBALONS. I think you have mis-understood the question and the meaning od expected cost.

Also as you are new to codechef, you do not seem familiar with the working of online judge. You do not need to enter stuff like “cout << “Expected cost for the bill is:”<<”$"<<total;" or use getchar() at the end. I would suggest you solve some easier question and come back to this later.

As far as debugging your code is concerned you have misunderstood the question completely and it is not at all relevant to the question. I would suggest you read the question again and also have a look at its editorial which explains how to solve it.

Thanks for your reply
was this the question?
Elephant would choose out of balloons and will give a pattern out of that and the estimated cost I have to find ?.and please also tell me that after completing my code I have to remove “cout<<” statements?? and then upload it??