题目链接: xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 491    Accepted Submission(s): 142 Problem Description As we all known, xiaoxin is a brilliant coder. He knew **pal…
xiaoxin juju needs help 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5651 Description As we all known, xiaoxin is a brilliant coder. He knew palindromic strings when he was only a six grade student at elementry school. This summer he was working a…
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5651 bc:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=682&pid=1002 xiaoxin juju needs help  Accepts: 150  Submissions: 966  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 6…
xiaoxin juju needs helpTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uSubmit Status DescriptionAs we all known, xiaoxin is a brilliant coder. He knew **palindromic** strings when he was only a six grade student at elementry sc…
xiaoxin juju needs help Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1159    Accepted Submission(s): 335 Problem Description As we all known, xiaoxin is a brilliant coder. He knew **palindrom…
http://acm.hdu.edu.cn/showproblem.php?pid=5651 题意:生成回文串.输出所有回文串的可能数. 题解:mod除法会损失高位,用逆元来代替除法,模板如下 ac代码: #include<stdio.h> #include<string.h> #include<iostream> #include<string> using namespace std; ; int num[maxn]; //char s[maxn]; t…
分析:求一下组合数 首先,如果不止一个字符出现的次数为奇数,则结果为0. 否则,我们把每个字符出现次数除2,也就是考虑一半的情况. 那么结果就是这个可重复集合的排列数了. fact(n)/fact(a_1)/fact(a_2)/..../fact(a_n)fact(n)/fact(a​1​​)/fact(a​2​​)/..../fact(a​n​​). #include<cstdio> #include<cstring> #include<queue> #include…
组合数杨辉三角打表,这样避免了除法求逆元. #include<cstdio> #include<cstring> #include<cmath> #include<queue> #include<algorithm> using namespace std; ; +; long long c[maxn][maxn]; ]; char s[maxn]; void init() { c[][]=; ;i<=;i++) c[i][]=; ;i&l…
xiaoxin juju needs help  Accepts: 150  Submissions: 966  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 xiaoxin巨从小就喜欢字符串,六年级的时候他就知道了什么是回文串.这时,xiaoxin巨说到:如果一个字符串 SS 是回文串,那么该字符串从前往后看和从后往前看是一样一样的. 六年级的暑假,xiaoxin很快…
xiaoxin juju needs help 题意:给你一个字符串,求打乱字符后,有多少种回文串.                      (题于文末) 知识点: n个元素,其中a1,a2,····,an互不相同,进行全排列,可得n!个不同的排列. 若其中某一元素ai重复了ni次,全排列出来必有重复元素,其中真正不同的排列数应为 ,即其重复度为ni! 同理a1重复了n1次,a2重复了n2次,····,ak重复了nk次,n1+n2+····+nk=n. 对于这样的n个元素进行全排列,可得不同排…