You are viewing a single comment's thread. Return to all comments →
Please chek my approach. Let say the set A = {a1,a2,a,3,a4.. an};
a1 | a2 a1a2 | a3 a1a3 a2a3 a1a2a3 | ....
the answer for the one element is ans[1]; ans[2] = 2^a1 + 2^a2 + (2^a1 * 2^a2); ans[2] = ans[1] + a^a2 +(ans[1]*2^a2); => ans[i] = ans[i-1](2^i + 1) + 2^i.
But in the editorial, it is mentioned as somewhat different.
Seems like cookies are disabled on this browser, please enable them to open this website
Shashank and List
You are viewing a single comment's thread. Return to all comments →
Please chek my approach. Let say the set A = {a1,a2,a,3,a4.. an};
a1 | a2 a1a2 | a3 a1a3 a2a3 a1a2a3 | ....
the answer for the one element is ans[1]; ans[2] = 2^a1 + 2^a2 + (2^a1 * 2^a2); ans[2] = ans[1] + a^a2 +(ans[1]*2^a2); => ans[i] = ans[i-1](2^i + 1) + 2^i.
But in the editorial, it is mentioned as somewhat different.