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 ...
随机推荐
- iCn3D结构查看器的实现方法
iCn3D Structure Viewer:iCn3D结构查看器 演示效果如下: 上面只是一个Basic UI的演示,如果要Advanced UI的话可以去NCBI官网看API
- 2018.07.01洛谷P2617 Dynamic Rankings(带修主席树)
P2617 Dynamic Rankings 题目描述 给定一个含有n个数的序列a[1],a[2],a[3]--a[n],程序必须回答这样的询问:对于给定的i,j,k,在a[i],a[i+1],a[i ...
- 2018.09.16 loj#10241. 取石子游戏 1(博弈论)
传送门 好像是某年的初赛题啊. 有个很显然的结论. 当n" role="presentation" style="position: relative;&quo ...
- BZOJ 1014 [JSOI2008]火星人prefix (Splay + Hash + 二分)
1014: [JSOI2008]火星人prefix Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 8112 Solved: 2569[Submit] ...
- 8) pom.xml
http://maven.apache.org/ref/3.3.3/maven-model/maven.html 执行mvn命令的时候默认文件名pom.xml 也可以通过 -f 指定 比如 mvn - ...
- vs2015 cmd.exe已退出 代码为1
https://blog.csdn.net/changbin91/article/details/42874377?utm_source=blogxgwz0 https://blog.csdn.net ...
- (KMP)Oulipo -- poj --3461
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=92486#problem/B http://poj.org/problem?id=3461 ...
- (网络流 最大流 Dinic || SAP)Control -- hdu --4289
链接: http://acm.hdu.edu.cn/showproblem.php?pid=4289 http://acm.hust.edu.cn/vjudge/contest/view.action ...
- pytest 入门及运行
关于pytest的入门教程,官网及网上已经很多了,那再多一点也无所谓吧!OK,进入正题~ 下面是一个测试用例,test_one.py def test_passing(): assert (1, ...
- Codeforces735C Tennis Championship 2016-12-13 12:06 77人阅读 评论(0) 收藏
C. Tennis Championship time limit per test 2 seconds memory limit per test 256 megabytes input stand ...