2007年9月18日

开始博弈喽 先切一道很水很水的题pku 1740

摘要: #include using namespace std; int a[10]; int b[101]; int main() { int n,i,flag; while(cin>>n&&n!=0) { flag=0;for(i=0;i>a[i]; b[a[i]]++; } for(i=0;i<=100;i++) ... 阅读全文

posted @ 2007-09-18 20:04 xmx 阅读(348) 评论(0) 推荐(0)

2007年9月17日

pku 1014 感觉没啥,给一个模重要

摘要: #include using namespace std; int ok ; int d[6] ; void find ( int now , int x ) { if ( x d[x] ? d[x] : t ; if ( now - s * (x+1) != 0 ) for ( i = s ; i >= 0 ; i -- ) { find ( now - i * (x+1... 阅读全文

posted @ 2007-09-17 22:57 xmx 阅读(651) 评论(0) 推荐(0)

2007年9月16日

一点小东西

摘要: //求n的阶乘转成10进制表示,末尾有多少个0的代码。 int f(int n) { int k = 5; int r = 0; while( n >= k) { r += n/k; k *= 5; } return r; } 然后这个还可以扩展为s进制的情况,这个等我扩出来了再写^_^ 算了,先写点初步的吧 就是... 阅读全文

posted @ 2007-09-16 22:59 xmx 阅读(156) 评论(0) 推荐(0)

2007年9月15日

HUN 11006 居然re了这么多次还没过,,,郁闷,,,,明天继续

摘要: #include using namespace std; struct par { string ma; string fa; }pp[100][1000]; string checkss(string a,string b,string c) { string re=""; int len=c.length(); fo... 阅读全文

posted @ 2007-09-15 00:25 xmx 阅读(238) 评论(0) 推荐(0)

2007年9月14日

Sylvester construction 11009

摘要: #include using namespace std; int a[64],b[64]; __int64 poww(int x,int y) { __int64 t=1; for(int j=0;jnu)) break; return i; } int cc(__int64 d,__int64 e) {int s,t;... 阅读全文

posted @ 2007-09-14 14:09 xmx 阅读(158) 评论(0) 推荐(0)

zju 2678 Bishops on a Toral Board

摘要: 其实就是求m和n的最大公约数,不过要大数,,可以用Euclid || stein写 #include #include char a[101],b[101]; int divide(int l,int ll); int big(int l,int ll,char a[],char b[]); void mod(int l,int ll); char x[101]; int ma... 阅读全文

posted @ 2007-09-14 00:20 xmx 阅读(319) 评论(0) 推荐(0)

2007年9月10日

pku2774 keys: 后缀数组,三分,时间复杂度,模版

摘要: #include #include #include using namespace std; const int maxn=210000; char s[maxn]; int len,k; int sa[maxn],rank[maxn],h[maxn],height[maxn]; int num[maxn]; inline bool leq(int a1, int a2, int b1, int... 阅读全文

posted @ 2007-09-10 22:51 xmx 阅读(736) 评论(0) 推荐(0)

2007年9月9日

今天的比赛

摘要: nice~nice~~nice~~~nice~~~~nice~~~~~不爽... 今天比赛的进程大致就是这样的,前面5题很顺利的就过了,并且一直排在前三... 可是,到了D题,由于题目叙述相当有问题...实例和叙述严重不符,结果无奈,在那边猜题目的意思.然后实在没办法,只能把所有可能的情况都试着提交了一下,但是still wa,提交了3次,很快,剩下的3个小时就unnice地过了,k饭... 回来... 阅读全文

posted @ 2007-09-09 23:47 xmx 阅读(148) 评论(0) 推荐(0)

2007年9月8日

pku 1743 后缀树~~~晕死我了

摘要: #include #include #include #include using namespace std; #define LimitN 100000 #define TC 100000 typedef struct node *point; struct node { point pl,sl; point chd,bro; ... 阅读全文

posted @ 2007-09-08 22:08 xmx 阅读(850) 评论(0) 推荐(0)

看人家的东西发现的一个小小的问题^_^

摘要: 原来abs()只能返回int型的,int64和long long需要重写的 阅读全文

posted @ 2007-09-08 19:38 xmx 阅读(151) 评论(0) 推荐(0)

导航