Partitioning by Palindromes uva111584

609 단어 동적 기획
main algorithm:
to count how many Palindromes a string include
give out   all the  way it combine, and judge whether its a Palindromes, if it is, f[i] = min(f[i]. f[j-1]+1)
code:
#include
#include
#include
using namespace std;
const int N = 1005;
int dp[N][N];
char str[N];
int f[N];
bool judge(int l, int r) {
	while(l

좋은 웹페이지 즐겨찾기