Question help

I am really stuck with this, Test cases give SIGSEGV, My code is available at here
Question :
Generating the array given on some pattern (If index even then this else that)
With Q queries given, I need to find out if given integer value can be obtained by adding some of the elements of array or not. return true if yes else no.

I tried the subset-sum approach, but I can’t figure out the issue with my code. Please help and correct me if I am wrong with the approach.
I will be happy to discuss and learn. Consider me a noob, I am just starting with competitive programming.

I see you guys are top contributors, Please help me

No i will not help , as it’s from ongoing contest LOL


The link you provided is running C++ program in Python 2 compiler of IDE

Which contest?

20 char

1 Like

It is not from Oct Challenge as far as I know.
Pls confirm from which contest it is.

Ansys krke Kuch hai hackerearth pe…

PS : this is not my screenshot …my college friend send me …
@aryan12 @s5960r @rude009


So @hard_try, pls don’t post stuff and ask hints from an ongoing contest. Try to play fair, coz if you ask hints, you won’t benefit. This is because if the same type of question comes in an exam, you will not know the logic of it, coz you had asked help in this question. And the truth is that no one will help you in an exam.


We will discuss after 6pm …this contest will end …ok…

1 Like

Please ignore that, It was by mistake

Ok, now you can :slight_smile:, it’s past 6:00 PM
I had tried the approach of using subset sum using bitset but Memory allocation could not be made. @ssrivastava990