codeforce 611B New Year and Old Property
暴力搞
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; long long a,b;
long long tmpa,tmpb;
long long num1[],num2[];
int tot1,tot2; int main()
{
// freopen("F:\\info.txt","w",stdout);
scanf("%lld%lld",&a,&b);
tmpa=a;
tmpb=b;
tot1=;tot2=;
while(tmpa) num1[tot1++]=tmpa%,tmpa=tmpa/;
while(tmpb) num2[tot2++]=tmpb%,tmpb=tmpb/; long long c=; long long ans=; for(int len=tot1;len<=tot2;len++)
{
for(int i=;i<len-;i++)
{
c=;
for(int j=;j<len;j++)
{
if(i==j) continue;
else c=c+(long long)pow(2.0,j);
}
// printf("%lf\n",c); if(c-a>=&&b-c>=) ans++;
}
}
printf("%lld\n",ans);
return ;
}
codeforce 611B New Year and Old Property的更多相关文章
- 探究@property申明对象属性时copy与strong的区别
一.问题来源 一直没有搞清楚NSString.NSArray.NSDictionary--属性描述关键字copy和strong的区别,看别人的项目中属性定义有的用copy,有的用strong.自己在开 ...
- JavaScript特性(attribute)、属性(property)和样式(style)
最近在研读一本巨著<JavaScript忍者秘籍>,里面有一篇文章提到了这3个概念. 书中的源码可以在此下载.我将源码放到了线上,如果不想下载,可以直接访问在线网址,修改页面名就能访问到相 ...
- -Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HO 解决办法
最近在使用maven,项目测试的时候出现了这么一个错.-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2 ...
- python property理解
一般情况下我这样使用property: @property def foo(self): return self._foo # 下面的两个decrator由@property创建 @foo.sette ...
- Android动画效果之Property Animation进阶(属性动画)
前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...
- Android动画效果之初识Property Animation(属性动画)
前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...
- # ios开发 @property 和 Ivar 的区别
ios开发 @property 和 Ivar 的区别 @property 属性其实是对成员变量的一种封装.我们先大概这样理解: @property = Ivar + setter + getter I ...
- Cesium原理篇:Property
之前主要是Entity的一个大概流程,本文主要介绍Cesium的属性,比如defineProperties,Property(ConstantProperty,CallbackProperty,Con ...
- 为Guid数据类型的属性(property)赋值
先来看看数据库表中的字段设计: 在数据库的数据类型为uniqueidentifier. 而在程序中对应的数据类型为GUID. property有get和set,也就是说能获取值也可以赋值.
随机推荐
- Thinkphp与Ucenter整合笔记
ucenter手册:http://www.phpddt.com/manual/ucenter/html/index.htm 参考:http://www.thinkphp.cn/topic/1557.h ...
- linuxmint更改权限
sudo chmod -R 777 要更改的目录或文件
- linux查看文件及文件夹的大小
最近发现服务器的磁盘容量使用率超过了90%,所以有必要查看是哪个文件占用了太多的空间, 服务器系统:CentOS6.5 df -h #查看磁盘使用情况,步骤1 cd / #切换到根目录, 步骤2 du ...
- js中Object.__proto__===Function.prototype
参考:http://stackoverflow.com/questions/650764/how-does-proto-differ-from-constructor-prototype http:/ ...
- DISUBSTR - Distinct Substrings
DISUBSTR - Distinct Substrings no tags Given a string, we need to find the total number of its dist ...
- jquery带小图的图片轮换效果
右边显示大图,左边显示小图 <style> ul{ list-style:none; padding:0px; margin:0px;} li{ list-style:none; padd ...
- java vector 和ArrayList的区别
相同点: 1.都是使用数组存储数据 不同点: 1.Vector是显示安全的,ArrayList是线程不安全的 Vector部分代码: public synchronized boolean add(E ...
- Git本地项目上传 & SourceTree & GitHub 简单使用
Git(分布式版本控制系统) Git是一款免费.开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理 ...
- UVALive 2035 The Monocycle(BFS状态处理+优先队列)
这道题目真是非常坎坷啊,WA了很多次,但所有的思路都是奔着广搜去想的,一开始出现了比答案大的数据,才想到了应该是优先队列,再说加上也肯定不会错.一开始我读错了题意,以为旋转并且前行需要的时间跟其他一样 ...
- html5 之本地数据存储
HTML5 提供了两种在客户端存储数据的新方法: localStorage - 没有时间限制的数据存储 sessionStorage - 针对一个 session 的数据存储 cookie与webSt ...