I tried the problem www.codechef.com/problems/CBFEAST/ and could only come up with algorithms for 1st and 2nd subtask. For subtask 2 I planned to use segment trees, so I wrote a segment tree code for my own use.
The BUILD function gives a SIGSEGV error. I have tried the same TREE on leetcode and SPOJ and did not receive any segmentation fault.
For sub2 I build a segment tree representing 10^7 buckets and each bucket represents 100 colors for a total of 10^9 colors.
Please help me with this, to make it easy to help me I have figured out the following things :
- Even if I use a small n = 100 instead of 10^7, I receive SIGSEGV.
- Build function definitely leads to SIGSEGV, as I tried the code with only build and no other code.
- However when I used n = 64,I Did not receive SIGSEGV.