### Meenachinmay's blog

By Meenachinmay, history, 8 months ago, ,

the direct formula is given in the problem. we just need to use that but a bit magic can work here rather than a brute force approach. the solution is like: run a loop from k=1 to k <= 10 //(constraints are 10**5 so this loop will work perfectly) then check for every K in given formula like... long long num = ((1LL << k) — 1) * ((1LL) << (k-1)) // 2^k — 1 * 2^(k-1) is given then check that this num is even or not if yes add this to ans. repeat same for the entire loop at the end you will end up with your ans.

•
• -16
•

 » 8 months ago, # |   0 please add your comment for disliking it will help me.....:)
•  » » 8 months ago, # ^ |   +4 NOdislike only
•  » » » 8 months ago, # ^ |   0 ok...do what you like to do....best of luck
•  » » » » 8 months ago, # ^ |   +1 I didn't dislike, but some possible things you can do to improve your post is - Typeset the Math better. Provide paragraphs, capitalise first letter of the sentences and end sentences clearly. For example, when you said "If yes, then do this". That's a new sentence. Provide a proof of how far k must be computed. Also show your thought process. That initially, the problem looks very difficult but the observation that we don't need to compute too many numbers makes it very simple. You can post your code on here too. Lastly, I think a reason a lot of people downvoted was that to most of the programmers here, this problem would have been vary basic.
•  » » » » » 8 months ago, # ^ |   0 first of all very thanks for guiding me and i did not know these all things and even i did not know that can i post my code here or not so i didnt. but next time i will try my best according to your guidance.
•  » » » » » » 8 months ago, # ^ |   0 Another thought I have is that while telling the solution to a problem, don't directly start with the answer. First, start with the point of view of someone who just saw this problem and doesn't know what to do. Then slowly, bit by bit, reveal the solution.
•  » » 8 months ago, # ^ | ← Rev. 2 →   0 Tutorials are meant to be read, and not only written. Perhaps if you formatted your tutorial better and showed some AC code, etc, it would be received better.Also, we technically only need to loop from k = 1 to k = 8, as once k = 9 the divisor > 100000.As for me, I am a hypocrite: I loops until 9 :P32582752
•  » » » 8 months ago, # ^ |   0 i just gave the rough idea that how can someone can approach the problem nothing else but i did not know much about this community so thats why next time i will do my best btw thanks for your valuable comment.
•  » » » » 8 months ago, # ^ |   0 Good luck!On a side note: Codeforces seems to have a tradition of downvoting. If you want more open discussion, I recommend you join the codeforces discord (you can discuss problems/solutions free from voting system)
•  » » » » » 8 months ago, # ^ |   0 i dont care about downvote or any up vote i am not doing CP just because of leaderboard or upvotes i am just do it coz i like to do it and making myself i more better intelligent person as simple as that. :( btw thanks very much for suggestion dear :)