WHY ADDING THE ARRAY??
for(int i=1;i<=n;i++){
ar[i]+=ar[i-1];
cnt[ar[i]]++;
}
why we need to subtract from the mask
for(int i=1;i<=n;++i){
ans+=dp[(1LL<<20LL)-1LL-ar[i]][20];
}
WHY DIVIDING BY ANS/2
EXPLAIN?
WHY ADDING THE ARRAY??
for(int i=1;i<=n;i++){
ar[i]+=ar[i-1];
cnt[ar[i]]++;
}
why we need to subtract from the mask
for(int i=1;i<=n;++i){
ans+=dp[(1LL<<20LL)-1LL-ar[i]][20];
}
WHY DIVIDING BY ANS/2
EXPLAIN?
Please provide the complete code in coding blocks IDE, if this is from some editorial video please raise doubt for that video, as I cannot guess what are you referring to.
there is no video explanation of this question- And Subarrays.
you have the code … for the questions you are admin( as per Iknow) plz explain how it works …plz see the full code (sos ) part I understood but rest I am just guessing not sure…
We do not have access to your code unless you provide it to us, using coding blocks IDE.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.