分析:求一下组合数 首先,如果不止一个字符出现的次数为奇数,则结果为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…
题目链接: 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 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…
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…
组合数杨辉三角打表,这样避免了除法求逆元. #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…
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #endif int a, b, c, n; scanf("%d", &n); while (n--){ scanf("%d%d", &a, &b); a…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 水题啊水题 还给我WA了好多次 因为我在j<w[i]的时候状态没有下传.. #include <cstdio> #include <algorithm> #include <cstring> using namespace std; typedef long long LL; typedef pair<int,int> PII; #define PB…
Just a Numble Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2107    Accepted Submission(s): 987 Problem Description Now give you two integers n m, you just tell me the m-th number after radix…