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通过LIstView显示文件列表

    [绥江一百]http://www.sj100.net                                                  欢迎,进入绥江一百感谢点击[我的小网站,请大家多 ...

  2. Java之绘制艺术图案

    前面已经介绍过绘制方法.这里不再赘述. package com.caiduping; import java.awt.Color; import java.awt.Graphics; import j ...

  3. 第三十三篇、富文本 NSMutableAttributedString

    // 设置颜色等 NSMutableDictionary *arrDic = [NSMutableDictionary dictionary]; arrDic[NSForegroundColorAtt ...

  4. 手机看youtube的方法|一个好用的VPN

    俗话说:网络无国界.但是由于天朝的限制,我们无法访问YouTube .谷歌.twitter等一些国外网站. 这个时候我们就需要FQ.最直接有效的方法就是:VPN(虚拟专用网络). 虚拟专用网络的功能是 ...

  5. OC6_目录及文件的创建

    // // main.m // OC6_目录及文件的创建 // // Created by zhangxueming on 15/6/19. // Copyright (c) 2015年 zhangx ...

  6. button按钮在IE6、7、8、9、10中处理方式并不相同[转]

    http://msdn.microsoft.com/en-us/library/ms534696%28v=vs.85%29.aspx 转自:http://my.oschina.net/fz04003/ ...

  7. Git的安装以及一些操作

    1.安装Git-2.5.1-64-bit.exe  一直下一步直至完成 2.注册github账号 官网地址:https://github.com/github 3.找到一个按钮“New Reposit ...

  8. Apache 编译安装

    # wget http://www.apache.org/dist/httpd/httpd-2.2.9.tar.gz  (此处我是直接用的下载好的包) # tar -zxvf httpd-2.2.9. ...

  9. CentOs Linux 分区建议

    硬盘分区方案 在计算机上安装Linux系统,对硬盘进行分区是一个非常重要的步骤,下面介绍几个分区方案. (1)方案1(桌面)/boot:用来存放与Linux系统启动有关的程序,比如启动引导装载程序等, ...

  10. linux实现nginx按照日期存储日志

    通过shell脚本实现+定时任务+nginx信号管理实现日志按日期存储. 1.编写shell脚本,实现日志按日期存储 #!/bin/bash base_path='/home/wwwlogs/' lo ...