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.不过还是得 ...
随机推荐
- Servlet之编码过滤
创建CharactorFilter类,实现javax.servlet.Filter接口: package com.caiduping; import java.io.IOException; impo ...
- java实现的身份证照片脸部识别(头像截图) 以及OCR字体识别
断断续续地折腾了大半个月,终于把身份证照片脸部识别以及OCR字体识别功能用Java实现了,需求很简单:通过摄像头所照的一张放在黑色底板上的身份证照,识别照片上身份证里面的人名和地址(OCR中文),再截 ...
- 拿到内存中dom元素的最后样式进行修改obj下的currentStyle方法
在用dom操作在对页面中的<style></style>里的样式进行操作时,发现时无效的,我觉得是因为页面DOM解析时此标签的样式内容才会被读到内存中,因此JS操作时取不到此标 ...
- Illegal pattern character 'i' 解决问题
java.lang.IllegalArgumentException: Illegal pattern character 'i' at java.text.SimpleDateFormat.comp ...
- opencv 手写选择题阅卷 (四)Android端 手机应用开发
opencv 手写选择题阅卷 (四)Android 手机应用开发 在PC端把代码调通以后开始开发Android 手机应用,因为主要功能代码为C++代码,所以需要通过NDK编译,JAVA通过JNI方式调 ...
- Qt绘制异形窗体
异形窗体即不规则窗体,一般采用png图片,一般绘制异形窗体分两步: 1.设置遮罩区 2.绘制图片 使用png图片的透明部分作为遮罩区,然后绘制图片,这样我们就看到一个只绘制了非透明部分的图形,废话 ...
- random between [a,b]、(a,b]、[a,b)
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; ; /*c ...
- ubuntu windows 双系统 磁盘乱搞 grub 导致 error:no such partition grub rescue>
乱搞分区磁盘什么的导致开机和这位仁兄一样:http://zhidao.baidu.com/question/495602654256708364.html?ssid=0&from=100187 ...
- 仿春雨医生 安卓app(android)
仿春雨医生 安卓app(android) 目前APP处与开发完善中,可过程序自下载更新,如有BUG报错,请联系QQ 131 065 1206 支持安卓(android) .IOS(IPHONE),PA ...
- 【C#】添加鼠标管轮事件
对FlowLayoutPanel添加鼠标滚轮事件 在mainform中添加事件 his.flowLayoutPanel1.MouseWheel += new System.Windows.Forms. ...