POJ 1243
#include <iostream>
#include <algorithm>
#include <cmath>
#define MAXN 50
using namespace std; int dp[MAXN][MAXN]; int main()
{
//freopen("acm.acm","r",stdin);
int g;
int l;
int i;
int j;
int time = ; while(cin>>g>>l)
{
dp[][] = ;
if(g == && l == )
{
break;
}
for(i = ; i <= g; ++ i)
{
dp[i][] = i;
}
for(i = ; i <= g; ++ i)
{
for(j = ; j <= l; ++ j)
{
if(j >= i)
{
dp[i][j] = pow((double),i)-;
}
else
{
dp[i][j] = dp[i-][j-]+dp[i-][j]+;
}
}
}
cout<<"Case "<<++ time<<": ";
cout<<dp[g][l]<<endl;
}
}
关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com
POJ 1243的更多相关文章
- POJ 1243 One Person
题意: 猜数字, 给定 G, L, G 表示可以猜的次数, 每猜一次, G减一, 假如猜的 number 大于 target, L 还需减一, 当 L == -1 或者 G==0 时, 若还没猜中, ...
- POJ题目细究
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP: 1011 NTA 简单题 1013 Great Equipment 简单题 102 ...
- 【转】POJ百道水题列表
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
随机推荐
- 492. Construct the Rectangle
static int wing=[]() { std::ios::sync_with_stdio(false); cin.tie(NULL); ; }(); class Solution { publ ...
- 22. Valuing Water 珍惜水资源
. Valuing Water 珍惜水资源 ① Humanity uses a little less than half the water available worldwide.Yet occu ...
- BeautifulSoup基本步骤
http://blog.csdn.net/kikaylee/article/details/56841789 ’BeautifulSoup是Python的一个库,最主要的功能就是从网页爬取我们需要的数 ...
- modelsim读写TXT文件
//open the file Initial Begin step_file = $fopen("F:/Company/Src/txt/step.v","r" ...
- webuploader php上传视频
webuploader 上传大视频文件 在网上找了一个,自己重新组合了下,两个主要的文件,再加上官方下载的文件.其中有几个重要的点. 1.上传存放视频目录为了测试 直接777 2.fileupload ...
- mybatis操作数据库
导入jar包 共13包 注意:mysql-connction的版本是5.1.7版低版本可能不行 2.编写配置文件 a. 配置连接数据库的文件 a.1创建数据库 user表 a.2配置文件目录 a.2. ...
- java Object解析
java Object是所有对象的根父类,所有对象都直接或间接集成自该类. java 的Object类也比较简单,有equals(Object).toString().finalize() java方 ...
- Android ADB命令基本常用操作
电脑配置好环境变量之后呢,在cmd里面自测一下,是否配置OK: 1.查看目前连接的设备: adb devices 2.使目前连接的设备重启: adb reboot 3.有时候由于设备冲突导致adb出现 ...
- 【Win10】文件拖放打开
在 Windows 10 中,通用应用程序在桌面环境下是支持从资源管理器拖放文件打开的. 这篇博文将演示拖放图片或文本文件,并在程序中打开显示. 前台 XAML: <Page x:Class=& ...
- kylin的配置账号密码的加密方法
kylin的配置账号密码的加密方法 kylin安装过程中,配置账户,其中密码是加密的.生成密码对应密文的 方法如下: import java.io.PrintStream; import org.sp ...