## sicily 1011 Lenny's Lucky Lotto 原

Ciel

### Description

Lenny likes to play the game of lotto. In the lotto game, he picks a list of N unique numbers in the range from 1 to M. If his list matches the list of numbers that are drawn, he wins the big prize.

Lenny has a scheme that he thinks is likely to be lucky. He likes to choose his list so that each number in it is at least twice as large as the one before it. So, for example, if = 4 and = 10, then the possible lucky lists Lenny could like are:

1 2 4 8

1 2 4 9

1 2 4 10

1 2 5 10

Thus Lenny has four lists from which to choose.

Your job, given N and M, is to determine from how many lucky lists Lenny can choose.

### Input

There will be multiple cases to consider from input. The first input will be a number C (0 < C <= 50) indicating how many cases with which you will deal. Following this number will be pairs of integers giving values for N and M, in that order. You are guaranteed that 1 <= N <= 10, 1 <= M <= 2000, and N <= M. Each N M pair will occur on a line of its own. N and M will be separated by a single space.

### Output

For each case display a line containing the case number (starting with 1 and increasing sequentially), the input values for N and M, and the number of lucky lists meeting Lenny’s requirements. The desired format is illustrated in the sample shown below.

### Sample Input

``````3
4 10
2 20
2 200``````

### Sample Output

``````Case 1: n = 4, m = 10, # lists = 4
Case 2: n = 2, m = 20, # lists = 100
Case 3: n = 2, m = 200, # lists = 10000``````

## 代码：

``````// Problem#: 1011
// Submission#: 1794222
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <iostream>
#include <cstring>
using namespace std;

#define N 11
#define M 2001
unsigned long long dp[N][M];

int main(){
int t,n,m,count;
unsigned long long re;
count = 0;
cin >> t;
while(t--){
cin >> n >> m;
re = 0;
memset(dp,0,sizeof(dp));
for ( int i=1 ; i<=m ; i++ ) dp[1][i]=1;
for ( int i=2 ; i<=n ; i++ ){
for (int j=1 ; j<=m ; j++){
for ( int k=i-1 ; k<=j/2 ; k++ )
dp[i][j] += dp[i-1][k];
}
}
for ( int i=n ; i<=m ; i++ ) re += dp[n][i];
cout << "Case " << ++count << ": n = " << n << ", m = " << m << ", # lists = " << re << endl;
}
return 0;
}``````

### Ciel

--============Oracle ADG搭建============== --==========准备阶段========= 1.检查primary为archivelog模式。 select log_mode from v\$database; 如果为noarchivelog模式，切换到archivelo......

UltraSQL
2018/07/23
0
0
【总结】使用Json4s实现Scala对象转Json

object JsonExample extends App { import org.json4s.JsonDSL._ import org.json4s.jackson.JsonMethods._ //第一部分，官网例子 case class Winner(id: Long, numbers: List[Int]) case c......

2018/06/27
0
0
Intel PRO/Wireless 2100, 2200 and 2915 devices for Debian5

Intel PRO/Wireless 2100, 2200 and 2915 devices This page describes how to enable support for WiFi devices based on Intel 2100, 2200 and 2915 chipsets on Debian systems. 目录 In......

2010/10/31
394
0
debian 7 下的一些错误提示解决办法

1、修改系统时间 cp /usr/share/zoneinfo/Asia/ShangHai /etc/localtime #时区为亚洲/上海 date 命令查看 2、用惯了vim，在debian下你会发现vi中无法使用delete和backspace键。 原来Debian中...

hiwill
2015/11/20
102
0
debian 5（lenny）源列表

2011/08/22
638
0

java 三元表达式

22分钟前
3
0

35分钟前
3
0
html:常见行内标签，常见块级标签,常见自闭合标签

43分钟前
3
0

sunny小喵

4
0