Meenachinmay's blog

By Meenachinmay, history, 3 weeks ago, In English,

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.

 
 
 
 
  • Vote: I like it  
  • -16
  • Vote: I do not like it  

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

please add your comment for disliking it will help me.....:)

  • »
    »
    3 weeks ago, # ^ |
      Vote: I like it +4 Vote: I do not like it

    NO

    dislike only

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      ok...do what you like to do....best of luck

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        I didn't dislike, but some possible things you can do to improve your post is -

        1. Typeset the Math better.
        2. 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.
        3. 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.
        4. 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.

        • »
          »
          »
          »
          »
          3 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          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.

          • »
            »
            »
            »
            »
            »
            3 weeks ago, # ^ |
              Vote: I like it 0 Vote: I do not like it

            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.

  • »
    »
    3 weeks ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    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 :P

    32582752

    • »
      »
      »
      3 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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.

      • »
        »
        »
        »
        3 weeks ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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)

        • »
          »
          »
          »
          »
          3 weeks ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          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 :)