there are 3 types of queries↵
↵
↵
_0 X add a number X_ ↵
_ 1 X remove the number X (X always exist)_↵
_ 2 X return the number of subsets that sum to X_↵
↵
↵
0<=X<=10^3↵
0<=number of queries <=10^3↵
↵
I tried to implement this using the knapsack approach but its bound to give TLE ↵
↵
any suggestions? Any help would be appreciated↵
↵
↵
↵
_0 X add a number X_ ↵
_ 1 X remove the number X (X always exist)_↵
_ 2 X return the number of subsets that sum to X_↵
↵
↵
0<=X<=10^3↵
0<=number of queries <=10^3↵
↵
I tried to implement this using the knapsack approach but its bound to give TLE ↵
↵
any suggestions? Any help would be appreciated↵
↵