摘要:
思路:简单动态规划#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 520#define Maxm 80002#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define rson(x) (x<<1|1)#define inf 0x7ffff 阅读全文
摘要:
思路:简单树状数组#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 120#define Maxm 80002#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define rson(x) (x<<1|1)#define inf 0x7ffff 阅读全文
摘要:
思路:dp[i][j]表示区间i,j变为回文串最少的代价.#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 2002#define Maxm 80002#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x=1;j--){ if(str[i]==str[j]){ ... 阅读全文