SPOJ : DIVCNT2 - Counting Divisors (square)

设\[f(n)=\sum_{d|n}\mu^2(d)\]则\[\begin{eqnarray*}\sigma_0(n^2)&=&\sum_{d|n}f(d)\\ans&=&\sum_{i=1}^n\sigma_0(i^2)\\&=&\sum_{i=1}
10次阅读

POJ 2151 Check the difficulty of problems 概率dp+01背包

题目链接:http://poj.org/problem?id=2151Check the difficulty of problemsTime Limit: 2000MSMemory Limit: 65536K问题描述Organizing a programming contest is not a
15次阅读

POJ 3071 Football 概率dp

题目链接:http://poj.org/problem?id=3071FootballTime Limit: 1000MSMemory Limit: 65536K问题描述Consider a single-elimination football tournament involving 2n te
6次阅读

POJ 3744 Scout YYF I 概率dp+矩阵快速幂

题目链接:http://poj.org/problem?id=3744Scout YYF ITime Limit: 1000MSMemory Limit: 65536K问题描述YYF is a couragous scout. Now he is on a dangerous mission whi
5次阅读

poj 3565 ants

/*poj 3565 递归分治还有用KM的做法这里写的分治 按紫书上的方法不过那里说的有点冗杂了可以简化一下 首先为啥可以分治 也就是分成子问题解决只要有一个集合 黑白的个数相等 就一定能一一匹配这个应该比较明显因为是special judge 所以我们只要保证每次处理的集合黑白相等就好了 关键是怎
6次阅读

poj 1821 Fence 单调队列优化dp

/* poj 1821 n*n*m 暴力*/#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#define maxn 110#define maxm 16010
16次阅读

poj 3372(找规律)

Candy DistributionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6033 Accepted: 3351DescriptionN children standing in circle who
11次阅读

poj 2369(置换群)

PermutationsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3041 Accepted: 1641DescriptionWe remind that the permutation of some f
8次阅读

poj 3270(置换群+贪心)

Cow SortingTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6993 Accepted: 2754DescriptionFarmer John's N (1 ≤ N ≤ 10,000) cows are
8次阅读

POJ 2096 Collecting Bugs 期望dp

题目链接:http://poj.org/problem?id=2096Collecting BugsTime Limit: 10000MSMemory Limit: 64000K问题描述Ivan is fond of collecting. Unlike other people who colle
6次阅读