Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll getBad(int level,ll cnt){
- if (cnt == 0)
- return 0;
- return getBad(level - 1, (cnt - 1) / 2) + (1LL << (level - 1));
- }
- ll getGood(int level,ll cnt){
- if (cnt == (1LL<<level)-1)
- return (1LL<<level)-1;
- return getGood(level - 1, (cnt + 1) / 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment