Good Bye 2015B
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的更多相关文章
- Good Bye 2015B(模拟或者二进制枚举)
B. New Year and Old Property time limit per test 2 seconds memory limit per test 256 megabytes input ...
- Good Bye 2013 A
A. New Year Candles time limit per test 1 second memory limit per test 256 megabytes input standard ...
- codeforces Gym 100500 J. Bye Bye Russia
Problem J. Bye Bye RussiaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/1005 ...
- linux(x64)下安装Matlab 2015b破解版(含安装包)
注意:在安装前请查看安装目录是否有足够空间!完全安装大概需要12G的空间!本人在安装后系统盘满了,导致无法启动图形界面.小伙伴们不要重蹈覆辙~ Environment Linux debian8 (x ...
- Matlab 2015b 启动时崩溃 MATLAB crashes during startup on Ubuntu 16.04
Matlab 启动时崩溃 MATLAB crashes during startup on Ubuntu Matlab 2015B Ubuntu 16.04 之前解决过,更新后问题又来了. 出 ...
- Good Bye 2018
Good Bye 2018 2018年最后一场CF,OVER! 弱弱的我只能做出3道A,B,D~~~~ 最后几分钟,感觉找到了C题的规律,结束的那一刻,提交了一发 "Wrong answer ...
- Good Bye 2018 (A~F, H)
目录 Codeforces 1091 A.New Year and the Christmas Ornament B.New Year and the Treasure Geolocation C.N ...
- English Voice of <<Bye Bye Bye>>
Bye Bye Bye - Lovestoned When i see you, looking back at me 当我看到你回首看我时 Watching this eye still 彼此凝视 ...
- Good Bye 2017(送命场)
9815人数场,9500+围观神仙打架...断断续续打Codeforces也快有一年啦,第一次打Good Bye场,满怀前排膜tourist的心愿参加了这场送命场,虽然没看到tourist.不过还是得 ...
随机推荐
- crackme_zapline分析
[破文标题]crackme_zapline 分析 [破文作者]CloAk [作者邮箱]@qq.com [作者主页] [破解工具]OD,... [破解平台]Windows --------------- ...
- 更换免开发证书账号出现的Your build settings specify a provisioning profile with the UUID"",however,no such provisioning profile was found
更换了免费的个人开发者账号后会出现这个错误 解决方法:在Finder中右键打开工程文件(显示包内容),用文本编辑器打开后缀名为.pbxproj的文件,command+f 搜索"PROVISI ...
- 总是你 2008-3 (献给L之一)
文/安然 总是你 是梦里的那份最温柔 轻轻碰触 不再敢轻易提及 总是你 是不经意的那份最感动 点点鲜活 从来就没有淡去 时间远走 我轻轻的收起 那段记忆 不再开启 但是 偶尔 偶尔 总是 总是在不经意 ...
- xamarin android——数据绑定到控件(四)
本文为通过自定义列表适配器定义ListView,以上文为基础,基于ListActivity. 定义列表项布局,包含一个图片显示,标题和描述 <LinearLayout xmlns:android ...
- thinkphp3.2引入php 实例化类
如果你的类库没有采用命名空间的话,需要使用import方法先加载类库文件,然后再进行实例化,例如:我们定义了一个Counter类(位于Com/Sina/Util/Counter.class.php): ...
- .net 将excel转成html文件
最近在做一个打印预览功能,但是开始没有头绪后来用excel做了一个模板,然后根据excel模板来生成新的excel并将其存储为html,可以通过http请求在浏览器中读取,并且打印,其他的不多说.方法 ...
- mongodb 级联操作查询时,关联条件
ObjectId id=new ObjectId("123"); c=c.where("relation_type.$id").is(id);
- Demo学习: CustomException
CustomException 捕获程序发生的异常. 1. 抛出各种异常 procedure TMainForm.UniButton1Click(Sender: TObject); begin PBy ...
- Wpf 简单制作自己的窗体样式
最近一直在搞wpf相关的东东,由于还在门外徘徊,所以第一篇blog写了简单的制作扁平化的wpf button样式,这一篇也简单的制作属于自己wpf 窗体的样式. 废话少说,下面就开始制作自己的窗体样式 ...
- ZOJ 1074 最大子矩阵和
Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any ...