Description

         有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。         其中,蜂房的结构如下所示。
 
 
 
 

Input

输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。        
        

Output

对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行。        
        

Sample Input

2 1 2 3 6
                

Sample Output

1 3
 
 
 水题,注意数据溢出
#include<iostream>
using namespace std;
__int64 s[];
void f()
{
s[]=;
s[]=;
s[]=;
for(int i=;i<;i++)
s[i]=s[i-]+s[i-];
}
int main()
{
int n,a,b;
cin>>n;
while(n--){
cin>>a>>b;
f();
cout<<s[b-a]<<endl;
}
//system("pause");
return ;
}

R - 一只小蜜蜂...(第二季水)的更多相关文章

  1. D - Counterfeit Dollar(第二季水)

    Description Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are t ...

  2. S - 骨牌铺方格(第二季水)

    Description          在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.         例如n=3时,为2× 3方格,骨牌的铺放方案有三种, ...

  3. F - The Fun Number System(第二季水)

    Description In a k bit 2's complement number, where the bits are indexed from 0 to k-1, the weight o ...

  4. T - 阿牛的EOF牛肉串(第二季水)

    Description          今年的ACM暑期集训队一共有18人,分为6支队伍.其中有一个叫做EOF的队伍,由04级的阿牛.XC以及05级的COY组成.在共同的集训生活中,大家建立了深厚的 ...

  5. I - Long Distance Racing(第二季水)

    Description Bessie is training for her next race by running on a path that includes hills so that sh ...

  6. V - 不容易系列之(4)――考新郎(第二季水)

    Description          国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这 ...

  7. X - A == B ?(第二季水)

    Description Give you two numbers A and B, if A is equal to B, you should print "YES", or p ...

  8. A - 高精度(大数)N次方(第二季水)

    Description Problems involving the computation of exact values of very large magnitude and precision ...

  9. Y - Design T-Shirt(第二季水)

    Description Soon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA ...

随机推荐

  1. IOS 实现QQ好友分组展开关闭功能

    贴出核心代码  主要讲一下思路. - (void)nameBtnClick:(myButton *)sender { //获取当前点击的分组对应的section self.clickIndex = s ...

  2. poj2778DNA Sequence (AC自动机+矩阵快速幂)

    转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud DNA Sequence Time Limit: 1000MS   Memory ...

  3. (转)matlab 字符串处理函数

    转自:http://www.cnblogs.com/emanlee/archive/2012/09/13/2683912.html % 字符串处理 a='  a';b='b  b';c='cccc'; ...

  4. Wordpress更换主题之后出错

    今天吃完午饭,休息休息,最近搞了一下google adsense,不过最终的审核没通过,我想会不会是界面不好看呢,饭后就在电脑旁,更换了几个wordpress主题,我的博客使用wordpress搭建的 ...

  5. NAS4Free 配置BT下载

    NAS4Free 9.3.0.2 开启BT下载功能 Services|BitTorrent 选中右上角的复选框 Peer port 是监听端口,用于接受外部连接,需要在路由器配置该端口到服务器,才能提 ...

  6. postgresql赋予/撤消 用户权限

    (1)给予权限:grant           grant select on 表名 to 用户名: (2)撤消权限:revoke           revoke select on 表名 from ...

  7. 异常处理与调试4 - 零基础入门学习Delphi53

    调试(Debug) 让编程改变世界 Change the world by program 调试(Debug) 在应用程序开发中检测.处理程序中的错误是一个非常重要的环节.在Delphi的集成开发环境 ...

  8. CodeForces 124B Permutations

    http://codeforces.com/problemset/problem/124/B Description You are given nk-digit integers. You have ...

  9. c# vs2010 winfrom控件检测网络环境

    写下以作备用,代码附上. public partial class UserControl1 : UserControl, IObjectSafety { //检测网络状态 [DllImport(&q ...

  10. jQuery中$.proxy()的原理和使用

    jQuery.proxy(),接受一个函数,然后返回一个新函数,并且这个新函数始终保持了特定的上下文(context )语境. jQuery.proxy( function, context ) fu ...