/* 给出一个数n,把它拆分成若干个数的和,要求最大的数在中间并向两边非递增.问拆法有多少种. 母函数.枚举中间的那一个数.由于左右对称.所以仅仅须要求左边部分的方案就可以. 注意,左右两部分的取数必须小于中间的数,中间的数是0的话则以n为最大取值. */ # include <stdio.h> # include <algorithm> # include <string.h> # include <iostream> typedef long long…
总时间限制: 1000ms 内存限制: 65536kB 描述 A sequence of positive integers is Palindromic if it reads the same forward and backward. For example:23 11 15 1 37 37 1 15 11 231 1 2 3 4 7 7 10 7 7 4 3 2 1 1A Palindromic sequence is Unimodal Palindromic if the values…
/*摘抄自博客:Recursively Palindromic Partitions Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 472 Accepted: 345 Description A partition of a positive integer N is a sequence of integers which sum to N, usually written with plus signs between…
题目 题意:求输入的数字的递归回文. 思路:答案等于这个数字一半之前的所有的 之和. #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int main() { int ca, t, i, j, x; ]; f[] =…
#include <iostream> #define MAXN 500 using namespace std; unsigned dp[MAXN][MAXN]; int main() { // freopen("acm.acm","r",stdin); int i; int j; int num; ; i < MAXN; ++ i) { dp[][i] = ; } ; i < MAXN; ++ i) { +; j <= i; ++…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
写下这道题的原因很简单= =,因为这一题的状态转移方程不好找,另一方面,我看到很多针对这一题写的解题报告都把累加状态说得模棱两可,甚至直接说成了一个单一状态,弄得本是菜鸟的我硬生生折磨了一上午画了几个10*10的表才想出来(各种表思路还不一样= =||) 题意:对整数N(N<250)进行划分,划分成单峰回文序列,题目给出K组N,然后求出相应总序列数目. 例如: 1: (1) 2: (2), (1 1) 3: (3), (1 1 1) 4: (4), (1 2 1), (2 2), (1 1 1…
UNIMODAL PALINDROMIC DECOMPOSITIONS Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5430   Accepted: 2641 Description A sequence of positive integers is Palindromic if it reads the same forward and backward. For example: 23 11 15 1 37 37…
题目链接:http://poj.org/problem?id=1322 题意: 思路: double C[N][N]; void init() { C[0][0]=1; int i,j; for(i=1;i<N;i++) { C[i][0]=C[i][i]=1; for(j=1;j<i;j++) C[i][j]=C[i-1][j-1]+C[i-1][j]; } } double Pow(double a,int b) { double ans=1; while(b) { if(b&1)…