Please help me find the error in this code. Its running well on my machine, but the error its showing when i submitted it is SIGSEGV.Help me correct it. I have no clue how to get it right.
//code removed
Please use code tags.
ar[b] doesn't contain an index b.
This algorithm will not pass the timelimit.
you mean I must use it as : int *ar=new int[b] ?I haven't saved b in ar[b]. Whats the solution?
Also, b will be up to 1000000000, tht's too large an array to possibly create.