• <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>
            voip
            風的方向
            厚德致遠,博學敦行!
            posts - 52,comments - 21,trackbacks - 0

            Ignatius and the Princess III

            Time Limit:1000MS  Memory Limit:65536K
            Total Submit:86 Accepted:66

            Description

            "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says.

            "The second problem is, given an positive integer N, we define an equation like this:
            N=a[1]+a[2]+a[3]+...+a[m];
            a[i]>0,1<=m<=N;
            My question is how many different equations you can find for a given N.
            For example, assume N is 4, we can find:
            4 = 4;
            4 = 3 + 1;
            4 = 2 + 2;
            4 = 2 + 1 + 1;
            4 = 1 + 1 + 1 + 1;
            so the result is 5 when N is 4. Note that "4 = 3 + 1" and "4 = 1 + 3" is the same in this problem. Now, you do it!"

            Input

            The input contains several test cases. Each test case contains a positive integer N(1<=N<=120) which is mentioned above. The input is terminated by the end of file.

            Output

            For each test case, you have to output a line contains an integer P which indicate the different equations you have found.

            Sample Input

            4
            10
            20
            

             

            Sample Output

            5
            42
            627
            
                  就是這個題目上次我寫整數劃分的時候半天也沒找到。。。直接用遞歸會超時!!
            代買如下:
            #include<cstdio>
            int main()
            {
                
            int i,j,n,c[121][121];
                
            for(i=1;i<121;i++)
                    
            for(j=1;j<121;j++)
                    
            {
                        
            if(i==1||j==1)
                            c[i][j]
            =1;
                        
            else if(i<j)
                            c[i][j]
            =c[i][i];
                        
            else if(i==j)
                            c[i][j]
            =c[i][j-1]+1;
                        
            else
                            c[i][j]
            =c[i][j-1]+c[i-j][j];
                    }

                
            while(scanf("%d",&n)!=EOF)
                
            {
                    printf(
            "%d\n",c[n][n]);
                }

                
            return 0;
            }


            
            
            posted on 2010-09-19 13:59 jince 閱讀(160) 評論(0)  編輯 收藏 引用 所屬分類: Questions
            哈哈哈哈哈哈
            人妻少妇久久中文字幕| 中文字幕久久欲求不满| 国产69精品久久久久9999APGF | 国产A三级久久精品| 久久精品一本到99热免费| 97久久综合精品久久久综合| 久久精品亚洲福利| 亚洲精品国产字幕久久不卡| 99久久精品免费看国产一区二区三区| 久久综合给合综合久久| 亚洲中文久久精品无码ww16 | 亚洲精品乱码久久久久66| 久久精品国产亚洲一区二区| 中文字幕精品久久久久人妻| 亚洲一本综合久久| 久久精品人人槡人妻人人玩AV| 亚洲国产成人精品女人久久久 | 国产精品久久久久久福利漫画| 久久er国产精品免费观看8| 久久久噜噜噜久久熟女AA片| 亚洲国产精品无码久久青草| 久久99精品国产| 漂亮人妻被黑人久久精品| 人人狠狠综合久久亚洲高清| 97超级碰碰碰碰久久久久| 国产精品一久久香蕉国产线看| 无码专区久久综合久中文字幕| 久久无码国产| 久久久久久国产精品无码下载| 青青草原综合久久| 人人狠狠综合久久亚洲88| 精品国际久久久久999波多野| 狠狠色综合网站久久久久久久高清| 久久久精品波多野结衣| 久久av免费天堂小草播放| 精品人妻伦一二三区久久| 国产精品内射久久久久欢欢 | 7777精品伊人久久久大香线蕉 | 亚洲中文久久精品无码| 久久久久波多野结衣高潮| 久久这里只有精品首页|