moaz123's blog

By moaz123, history, 8 years ago, In English

hey everyone , i am kind of new to writing blogs on codeforces so excuse me if I made any mistakes :) .

i am having a problem with problem (B. New Year and Old Property) (http://codeforces.com/problemset/problem/611/B) . I have been working on it for like 3 days and still not getting any progress .

You can find the code in the link : https://codeshare.io/ffeXX .

I don't know if i should explain the code or not but i will explain it in the link .

Thanks everyone for the great help .

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Try writing your own pow function. Check this for more info.

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

There are only 4 numbers of length(binary representation) 5 which can be included in our answer, 5 numbers of length 6, 6 numbers of length 7 . So check all the number ranging from length 2 to 63. http://codeforces.com/contest/611/submission/15113453 , this code may help

  • »
    »
    8 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    i know I handled that idea in the loop and but still remains both sides which i tried to get 2^n+1 and subtract 2^0 , 2^1 , 2^2 and count all the number between the two given numbers , i hope you my idea :) .