Archives for March 2008

HDU 1231 最大连续子序列

C++代码 /*   Title: 最大连续子序列   Problem URL: http://acm.hdu.edu.cn/showproblem.php?pid=1231   Author: Moqi   Date: 2008-03-19   Description:505951 2008-03-19 22:42:40 Accepted 1231 203MS 0K 857B C moqi    */   #include <stdio.h>    int main()    {        int i, k, n, max, sumk, flag;        int s[10001], sum[10001], a[10001];        while (scanf ("%d", &n))        {            flag = 0;            if (n == 0)                break;            sumk = k = max = 0;            for (i = 0; i < n; i++)            {                scanf("%d", &s[i]);                if (s[i] >= 0)                    flag = 1;                if (sumk >= 0)                {                    sumk += s[i];                    a[i] = k;                } […]

HDU 1228 A+B

C++代码 /*   Title: A + B   Problem URL: http://acm.hdu.edu.cn/showproblem.php?pid=1228   Author: Moqi   Date: 2008-03-19   Description:505495 2008-03-19 20:33:48 Accepted 1228 0MS 0K 826 B C moqi    */   #include <stdio.h>    #include <math.h>    int main()    {        int s, a, i, j;        char line[1024];        char num[10][5] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};        while (gets(line))        {            s = j = 0;            a = 0;            while (line[j] != ‘=’)            {                for (i = 0; i < 10; i++)                {                    if (line[j] == num[i][0] && line[j+1] == num[i][1])                    {                        a += i;                        while(line[j] != ‘ ‘)                            j++;                        break; […]

构建超级大站时可参考的一些资料zz

一个网站:http://highscalability.com/ 三本书: 《High Performance MySQL》, 《Building Scalable Web Sites》, 《Scalable Internet Architecture》。 Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1739737

几个链接搜索类PHP程序

今天在此文的指引下,我下载并测试了下列六个PHP程序,总体来说都比较不错,容日后分析代码: In-Link v2.3.2 多语言版 建立起自己的YAHOO 国外知名度颇高的搜索引擎phpdig,含有网页蜘蛛程序 LinksCaffe v2.5 WSN Links v2.55 多国语言版 indexu 引擎 Sphider 1.3.1e