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,也就是说能获取值也可以赋值.
随机推荐
- spring security 3中的10个典型用法小结
spring security 3比较庞大,但功能很强,下面小结下spring security 3中值得 注意的10个典型用法 1)多个authentication-provide可以同时使用 &l ...
- Google Gson的使用方法
用法1:从网络获取到json字符串之后,假如该字符串为data, Gson gson = new Gson(); HomeBean json = gson.fromJson(data, HomeBea ...
- english 释词
english 释词 [amount of & number of]the amount of /the number of指……的数量an amount of/a number of 指“大 ...
- 禁止root远程登录 sshd问题:A protocol error occurred. Change of username or service not allowed
在研究Linux安全的时候遇到一个问题,原本打算修改linux直接远程root登陆,修改为sshd的配置文件后 Nano /etc/ssh/sshd_config 把#PermitRootLogin ...
- MyEclipse 2015 如何使项目能够使用 Hibernate自动生成文件
在MyEclipse-Project facets 下 对hibernate这一栏打钩即可
- Mybatis 一对一,一对多,多对一,多对多的理解
First (一对一) 首先我来说下一对一的理解,就是一个班主任只属于一个班级,一个班级也只能有一个班主任.好吧这就是对于一对一的理解 怎么来实现呢? 这里我介绍了两种方式: 一种是:使用嵌套结果映射 ...
- 4位开锁<dfs>
题意: 有一个四位密码的锁,每一位是1~9的密码,1跟9相连.并且相邻的连个密码位可以交换.每改变一位耗时1s,给出锁的当前状态和密码,求最少解锁时间. 思路: 用bfs枚举出所有相邻交换的情况,并记 ...
- 10款免费Bootstrap后台模板演示及下载
自从有了类似Bootstrap这样强大的前端框架之后,无论我们是做静态页面,还是做网站主题,着实方便很多.即便有很多类似的其他国产.海外的前端框架比较,Bootstrap用户量以及功能文档还是比较大的 ...
- postgresql 在linux上的源码安装
http://my.oschina.net/hippora/blog/375292 下载源码并解压 [root@fnddb ~]# wget https://ftp.postgresql.org/pu ...
- [转]解决LinearLayout中控件不能居右对齐
在LinearLayout布局时使用右对齐(android:layout_gravity="right")控件对齐方式不生效,需要设置 android:layout_weight= ...