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. mono for android工具下载

    http://www.wuleba.com/25510.html Windows平台:http://xamarin.com/installer_assets/v3/Windows/Universal/ ...

  2. elasticsearch,http://ip:9200访问不到的解决办法

    现在解压elasticsearch之后,启动,通过http://localhost:9200可以访问的到,但是http://ip:9200访问不到,怎么办呢?带你解决,带你飞 修改elasticsea ...

  3. 0119——UIImageView的一些属性 和 简单动画实现

    1.contentMode view.contentMode = UIViewContentModeScaleAspectFill; 2.是否实现触摸 3.简单实现动画 图片的名字为campFire0 ...

  4. M - Candy Sharing Game

    Description A number of students sit in a circle facing their teacher in the center. Each student in ...

  5. (转) 新手入门:C/C++中的结构体

    本文转载于 http://pcedu.pconline.com.cn/empolder/gj/c/0503/567930_all.html#content_page_1 所有程序经过本人验证,部分程序 ...

  6. 分享几个实用的jquery工具函数

    1.$.browser对象属性 属性列表 说明  webkit webkit相关浏览器则返回true,否则返回false,如google,傲游.  mozilla mozilla相关浏览器则返回tru ...

  7. tuple只有一个元素的时候,必须要加逗号

    In [1]: a = (1) In [2]: a Out[2]: 1 In [3]: a = (1,) In [4]: a Out[4]: (1,) 这是因为括号()既可以表示tuple,又可以表示 ...

  8. c# List集合排序

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  9. RedHat下MySQL 5.6 安装、维护

    准备环境: RedHat 5系统.MySQL 5.6 rpm包 首先 上传mysql至服务器 1. 解压缩MySql [root@localhost]# tar -xvf MySQL-5.6.2_m5 ...

  10. Minimum Size Subarray Sum 解答

    Question Given an array of n positive integers and a positive integer s, find the minimal length of ...