首页 > 代码库 > SRM631 Div2 1000 ???

SRM631 Div2 1000 ???

保存代码,题解待更新。。。

 

 1 #include <cstdio> 2 #include <string> 3 #include <vector> 4 #include <map> 5 using namespace std; 6  7 #define LL long long 8  9 class TaroCoins{10 public:11     long long getNumber(long long N){12         LL pushOne = 0, notPush = 1;13         while(N){14             int dgt = N & 1; N >>= 1;15             if(!dgt)16                 pushOne += notPush;17             else18                 notPush += pushOne;19         }20         return notPush;21     }22 };
View Code

 

SRM631 Div2 1000 ???