Subsequence
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 3995    Accepted Submission(s): 1308
Problem Description
There is a sequenc...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 06:47:40   
                                阅读次数:
275
                             
                    
                        
                            
                            
                                错了29遍,终成正果。。。。。
根据题意,很容易的可以想到容斥。
然后的问题就是如何求
sum(n)=1^4+2^4+3^4+....+n^4;
有三种道路:
很显然:1^4+2^4+3^4+....+n^4=(n^5)/5+(n^4)/2+(n^3)/3-n/30;
则1,用java的大数去敲这个的代码。
2,用c++敲,但是用到分数取模,求逆元。
3,用c++敲,但是不用这...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 06:36:06   
                                阅读次数:
328
                             
                    
                        
                            
                            
                                /*
* hdu AC Me
* date 2014/5/13
* state AC
*/
#include 
#include 
#include 
#include 
using namespace std;
const int MAXN=100001;
char Arr[MAXN];
int cnt[26];
int main()
{
    //cout << "Hello wor...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 06:16:24   
                                阅读次数:
247
                             
                    
                        
                            
                            
                                /*
* hdu How many prime numbers
* date 2014/5/13
* state AC
*/
#include 
#include 
#include 
using namespace std;
bool isPrime(int x)
{
    int sqr=sqrt(x*1.0);
    for(int i=2;i<=sqr;i++)
    {...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 05:07:18   
                                阅读次数:
261
                             
                    
                        
                            
                            
                                Problem Description
The new semester begins! Different kinds of student societies are all trying to advertise themselves, by giving flyers to the students for introducing the society. However, due ...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 03:57:24   
                                阅读次数:
311
                             
                    
                        
                            
                            
                                插头DP。
题目要求构造出K条回路的方案数,而且不能出现环套环。
Sol:通过增加标记为来记录形成的回路数,假如不形成环的话就是在形成新的环路,此时,两边的插头个数要为偶数。
#include
#include
#include
#include
using namespace std;
const int MAXD=15;
const int STATE=1000010;
const i...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 03:53:23   
                                阅读次数:
272
                             
                    
                        
                            
                            
                                http://acm.hdu.edu.cn/showproblem.php?pid=4635
Strongly connected
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1381    Accepted Sub...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 03:26:53   
                                阅读次数:
248
                             
                    
                        
                            
                            
                                #include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
struct ssss
{
    ssss *c[26];
    int n,v;
}*s;
void insert(char *str,int v)
{
    int i,j,k,l;
    ssss *p,*q;
    p=...
                            
                            
                                分类:
其他好文   时间:
2014-05-14 15:06:54   
                                阅读次数:
357
                             
                    
                        
                            
                            
                                /*
* hdu 最小公倍数
* date 2014/5/13
* state AC
*/
#include 
using namespace std;
int gcd(int x,int y)
{
    while(x!=y)
    {
        if(x>y)x=x-y;
        else y=y-x;
    }
    return x;
}
int main()
...
                            
                            
                                分类:
其他好文   时间:
2014-05-14 14:29:59   
                                阅读次数:
225