• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            付翔的專欄
            在鄙視中成長 記錄成長的點滴
            posts - 106,  comments - 32,  trackbacks - 0

            今天做了一天的水題

            http://acm.hdu.edu.cn/showproblem.php?pid=1081

            二維的最大子序列

            int data[1025][1025],value[1025];

            int maxFun(int n)
            {
                
            int max,result= INT_MIN,i;
                
            for(max = 0,i = 0 ; i < n ; i ++)
                {
                    max 
            +=value[i];
                    
            if(max > result)
                        result 
            = max;
                    
            if(max < 0)
                        max 
            = 0;
                }
                
            return result;
            }
            using namespace std;
            int main()
            {
            //    freopen("in.txt","r",stdin);
                int i,j,k,T,max,maxResult;
                
            while(scanf("%d",&T)!=EOF)
                {
                    
                    
            for(i = 0; i < T ; i ++)
                        
            for(j = 0; j < T; j ++)
                            scanf(
            "%d",&data[i][j]);
                    max 
            = 0; maxResult = INT_MIN;
                    
            for(i = 0; i < T; i ++)
                    {
                        memset(value,
            0,sizeof(value));
                        
            for(j = i ; j < T ; j ++)
                        {
                            
            for(k = 0; k < T; k ++)
                                value[k] 
            +=data[j][k];

                            max 
            = maxFun(T);
                            
            if(max > maxResult)
                                maxResult 
            = max;
                        }
                    }
                    printf(
            "%d\n",maxResult);
                }
                
            return 0;
            }

            http://acm.hdu.edu.cn/showproblem.php?pid=1062
            字符串翻轉
            int main()
            {
                
            int T,i,len,j;
                
            char c,str[1000],result[1000];
                scanf(
            "%d",&T);
                getchar();
                
            while(T--)
                {
                    gets(str);
                    len 
            = strlen(str);
                    
            //strcpy(result," ");
                    for(j = 0,i = 0 ; i < len; i ++)
                    {
                        
            if(str[i] == ' ')
                        {
                            result[j] 
            = '\0';
                            printf(
            "%s ",strrev(result));
                            j 
            = 0;
                        }
                        
            else if(i == len - 1)
                        {
                            result[j
            ++= str[i];
                            result[j] 
            = '\0';
                            printf(
            "%s",strrev(result));
                        }
                        
            else
                        {
                            result[j
            ++= str[i];
                        }
                    }
                    printf(
            "\n");
                }
                
            return 0;
            }


            http://acm.hdu.edu.cn/showproblem.php?pid=1060

            這里是要用到 對于任意的數num 都可表示為  10^(a +b) 其中a>1 b < 1 且 10^b   的有效數字就是num 的有效數字
            給出一個n 求n^n 的最開始的數
            #include <iostream>
            #include 
            <cmath>
            using namespace std;
            int main()
            {
                
            int m,n,i,ans;
                
            double a,b;
                scanf(
            "%d",&n);
                
            for(i=0;i<n;i++)
                {
                    scanf(
            "%d",&m);
                    
            //a = m*log10(m*1.0);
                    b=m*log10(m*1.0)-(__int64)(m*log10(m*1.0));
                    b
            =pow((double)10,b);
                    ans
            =(int)b;
                    printf(
            "%d %d\n",(int)a,ans);
                }

                
            return 0;
            }


            posted on 2010-08-09 17:49 付翔 閱讀(110) 評論(0)  編輯 收藏 引用 所屬分類: ACM 數據結構

            <2010年7月>
            27282930123
            45678910
            11121314151617
            18192021222324
            25262728293031
            1234567

            常用鏈接

            留言簿(2)

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            CSDN - 我的blog地址

            博客

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            狠狠色丁香久久婷婷综合| 久久香综合精品久久伊人| 伊人色综合久久天天| 国产精品亚洲综合专区片高清久久久| 亚洲国产精品人久久| 亚洲国产精品无码久久九九| 久久婷婷五月综合国产尤物app | 精品久久久久久99人妻| 久久精品国产精品亚洲| 99久久国产宗和精品1上映| 九九久久自然熟的香蕉图片| 久久亚洲国产成人精品无码区| 久久人人爽爽爽人久久久| 欧美精品一区二区久久| 99久久er这里只有精品18| 亚洲日本va午夜中文字幕久久| 97超级碰碰碰久久久久| 久久亚洲国产精品成人AV秋霞| 亚洲国产天堂久久综合网站| 日本人妻丰满熟妇久久久久久| 蜜桃麻豆www久久| 波多野结衣中文字幕久久| 思思久久精品在热线热| 久久露脸国产精品| 91久久精品国产91性色也| 久久Av无码精品人妻系列 | 久久久噜噜噜久久中文福利| 久久九九免费高清视频| 久久99精品久久久久久9蜜桃| 麻豆一区二区99久久久久| 国产成人综合久久精品红| 久久影院久久香蕉国产线看观看| 国产精品一久久香蕉产线看| 日韩人妻无码精品久久久不卡| 欧美日韩精品久久久久| 久久久国产视频| 久久天天躁狠狠躁夜夜躁2014| 亚洲国产成人乱码精品女人久久久不卡 | 久久人妻少妇嫩草AV蜜桃| 久久免费视频6| 久久久精品久久久久影院|