Red is good Time Limit: 10 Sec Memory Limit: 64 MB[Submit][Status][Discuss] Description 桌面上有R张红牌和B张黑牌,随机打乱顺序后放在桌面上,开始一张一张地翻牌,翻到红牌得到1美元,黑牌则付出1美元.可以随时停止翻牌,在最优策略下平均能得到多少钱. Input 一行输入两个数R,B. Output 在最优策略下平均能得到多少钱.输出答案时,小数点后第六位后的全部去掉,不要四舍五入. Sample Input…
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4800 Problem Description A role-playing game (RPG and sometimes roleplaying game) is a game in which players assume the roles of characters in a fictional setting. Players take responsibility for acting…
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Description Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yumm…
1225. Flags Time limit: 1.0 secondMemory limit: 64 MB On the Day of the Flag of Russia a shop-owner decided to decorate the show-window of his shop with textile stripes of white, blue and red colors. He wants to satisfy the following conditions: Stri…
题目链接: C. Subsequences time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output For the given sequence with n different elements find the number of increasing subsequences with k + 1 elements. It is…
从低端向上,每个结点取下一层左右结点最大值和本身价值相加,dp[0][0]为最后结果 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; #define MAXN 510 typedef long long LL; LL a[MAXN][MAXN],dp[MAXN][MAXN]; LL sum = ,level; int main() { int i,j; scanf(…