Problem B:http://codeforces.com/contest/611/problem/B

B. New Year and Old Property

题意:问输入的年份a到b中转化为二进制后只有一个0的年份有几个。 

思路:不会位运算,当时没写出来,不过听说dfs就可以了

#include<bits/stdc++.h>
#define LL long long
using namespace std;
LL a,b,t;
void dfs(LL x,LL y){
if(x>b)
return;
if(a<=x&&x<=b&&y==)
t++;
if(y==)
dfs(x*,y+); dfs(x*+,y);
}
int main(){
cin>>a>>b;
t=;
dfs(,);
cout<<t<<endl;
return ;
}

Good Bye 2015B的更多相关文章

  1. Good Bye 2015B(模拟或者二进制枚举)

    B. New Year and Old Property time limit per test 2 seconds memory limit per test 256 megabytes input ...

  2. Good Bye 2013 A

    A. New Year Candles time limit per test 1 second memory limit per test 256 megabytes input standard ...

  3. codeforces Gym 100500 J. Bye Bye Russia

    Problem J. Bye Bye RussiaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1005 ...

  4. linux(x64)下安装Matlab 2015b破解版(含安装包)

    注意:在安装前请查看安装目录是否有足够空间!完全安装大概需要12G的空间!本人在安装后系统盘满了,导致无法启动图形界面.小伙伴们不要重蹈覆辙~ Environment Linux debian8 (x ...

  5. Matlab 2015b 启动时崩溃 MATLAB crashes during startup on Ubuntu 16.04

    Matlab 启动时崩溃 MATLAB crashes during startup on Ubuntu Matlab 2015B Ubuntu 16.04 之前解决过,更新后问题又来了.     出 ...

  6. Good Bye 2018

    Good Bye 2018 2018年最后一场CF,OVER! 弱弱的我只能做出3道A,B,D~~~~ 最后几分钟,感觉找到了C题的规律,结束的那一刻,提交了一发 "Wrong answer ...

  7. Good Bye 2018 (A~F, H)

    目录 Codeforces 1091 A.New Year and the Christmas Ornament B.New Year and the Treasure Geolocation C.N ...

  8. English Voice of <<Bye Bye Bye>>

    Bye Bye Bye - Lovestoned When i see you, looking back at me 当我看到你回首看我时 Watching this eye still 彼此凝视 ...

  9. Good Bye 2017(送命场)

    9815人数场,9500+围观神仙打架...断断续续打Codeforces也快有一年啦,第一次打Good Bye场,满怀前排膜tourist的心愿参加了这场送命场,虽然没看到tourist.不过还是得 ...

随机推荐

  1. Android之单选框

    MainActivity继承Activity使用OnCheckedChangeListener接口: package com.cdp.checkbox; import android.app.Acti ...

  2. 动态执行C#代码

    using System; using System.CodeDom.Compiler;using System.Collections.Generic;using System.Linq;using ...

  3. android apk 逆向中常用工具一览

    关于apk 逆向中的一些工具的使用,看了不少文章,也使用过有很长一段时间了,今天对此做一总结: 几种文件之间的转换命令: 1. odex -> smali java -jar  baksmali ...

  4. 一个JS内存泄露实例分析

    在看JS GC 相关的文章时,好几次看到了下面这个设计出来的例子,比较巧妙,环环相扣.   var theThing = null; var replaceThing = function () { ...

  5. ZigBee2006,2007,pro各个版本的区别

    文章转载自http://home.eeworld.com.cn/my/space-uid-361439-blogid-224722.html

  6. 查找-find -grep

    find#.#-name#"*pc"#|#xargs#grep#"Flag" “*.pc”设置要找的文件名grep后面是要找的字符串 #是空格

  7. IE9中jquery发生Object未定义原因及解决办法

    http://netwjx.github.io/blog/2012/04/15/object-undefined-in-jquery/ 最简单的使用IE9的兼容模式即可.

  8. 【C#】数据库备份及还原的实现代码【转载】

    [转载]http://www.codesky.net/article/200908/128600.html C#数据库备份及还原1.在用户的配置时,我们需要列出当前局域网内所有的数据库服务器,并且要列 ...

  9. Python Generators vs Iterators

    http://stackoverflow.com/questions/2776829/difference-between-python-generators-vs-iterators iterato ...

  10. java 两个日期之间的标准工作日(原创)

    package control; import java.text.ParseException; import java.text.SimpleDateFormat; import java.uti ...