题目大意:给你一个长度为 n 的 字符串表示一个乘法,一次操作随机选两个字符进行交换,进行m次操作,让你求出所有可能操作 的答案和. (1 <= n, m <= 50) 思路:巨难.. 对于固定位置的三个字符来说,把中间的看成*, 两边的为a,b, 这个产生的贡献为,a * b * C,C只与a, b和 * 的位置有关, 所以我们只要求出a*b的贡献就好啦. 我们定义dp[ a ][ b ][ c ][ k ] 表示三个字符分别是a,b,c, b在中间,还需要交换 k次的答案. 最后枚举三个…
Man Down Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2030 Accepted Submission(s): 743 Problem Description The Game “Man Down 100 floors” is an famous and interesting game.You can enjoy t…
B - Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Appoint description: Description A group of researchers are designing an experiment to test the IQ of a monkey. They wi…
G - FatMouse's Speed Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1160 Appoint description: Description FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4826 思路:dp[x][y][d]表示从方向到达点(x,y)所能得到的最大值,然后就是记忆化了. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define REP(i, a, b) for (int i = (a); i < (b); ++i)…
hdu 5791 Two Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1421 Accepted Submission(s): 630 Problem Description Alice gets two sequences A and B. A easy problem comes. How many pair of sequ…
H - Super Jumping! Jumping! Jumping! Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Appoint description: System Crawler (2015-11-18) Description Nowadays, a kind of chess game called “Su…