HackerEarth July Circuits '19 - XOR Operation

I’m unable to understand the logic behind this question. There’s no editorial on this question. Can someone please help me out ? Thanks :slight_smile:

I am not sure but this
https://www.codechef.com/COOK108A/problems/EXPTPROD
Question seems very much similar. And it has editorial as well. This might help :slight_smile:

4 Likes

Read https://www.codechef.com/COOK106A/problems/EXPXOR/ first.

Along with that, you will need digit DP to count total nos in the range [1,N] with ith bit on. Later you can work on the lines of EXPTPROD to find expect prob of ith bit on.

4 Likes

Thanks @l_returns @ aryanc403. I’ll check the links

1 Like