• <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>

            ACM___________________________

            ______________白白の屋
            posts - 182, comments - 102, trackbacks - 0, articles - 0
            <2010年10月>
            262728293012
            3456789
            10111213141516
            17181920212223
            24252627282930
            31123456

            常用鏈接

            留言簿(24)

            隨筆分類(332)

            隨筆檔案(182)

            FRIENDS

            搜索

            積分與排名

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

             

             題目地址 :

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

            題目描述:

            Hat's Fibonacci

            Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
            Total Submission(s): 2208    Accepted Submission(s): 684


            Problem Description
            A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.
            F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(n - 1) + F(n-2) + F(n-3) + F(n-4)
            Your task is to take a number as input, and print that Fibonacci number.
             

            Input
            Each line will contain an integers. Process to end of file.
             

            Output
            For each case, output the result in a line.
             

            Sample Input
            100
             

            Sample Output
            4203968145672990846840663646 Note: No generated Fibonacci number in excess of 2005 digits will be in the test data, ie. F(20) = 66526 has 5 digits.
             

             

             /*

            Mail to   : miyubai@gamil.com

            MyBlog    : baiyun.me

            Link      : http://www.cnblogs.com/MiYu  || http://m.shnenglu.com/MiYu

            Author By : MiYu

            Test      : 1

            Complier  : g++ mingw32-3.4.2

            Program   : Hat's Fibonacci

            Doc Name  : HDU_1250

            */



            /*


            高精度的水題 , JAVA  水過, 當然 用模板也一樣 


            */


            package main;

            import java.util.*;

            import java.math.*;

            import java.io.*;

            public class Main {

                public static void main(String[] args) {

                    Scanner cin = new Scanner ( System.in );

                    while ( cin.hasNext() ) {

                        int N = cin.nextInt();

                        if ( N <= 4 ) {

                            System.out.println ( 1 );

                        } else {

                            BigInteger one = new BigInteger ( "1" );

                            BigInteger two = new BigInteger ( "1" );

                            BigInteger three = new BigInteger ( "1" );

                            BigInteger four = new BigInteger ( "1" );

                            BigInteger res = new BigInteger ( "1" );

                            BigInteger temp = new BigInteger ( "1" );

                            for ( int i = 4; i < N; ++ i ) {

                                res = one.add(two).add(three).add(four);

                                temp = res;

                                one= two;

                                two = three;

                                three = four;

                                four = temp;

                            }

                            System.out.println( res );

                        }

                    }

                }


            }


             

            少妇人妻综合久久中文字幕| 久久久久久av无码免费看大片| 国产亚洲美女精品久久久| 内射无码专区久久亚洲| 久久九九精品99国产精品| 欧美久久精品一级c片片| 久久这里有精品| 99久久伊人精品综合观看| 亚洲国产精品久久久天堂| 狠狠色丁香久久综合婷婷| 久久综合亚洲色一区二区三区| 久久久久人妻精品一区二区三区 | 激情综合色综合久久综合| 久久精品中文字幕大胸| 久久香蕉一级毛片| 亚洲国产精品无码久久| 日本欧美国产精品第一页久久| 婷婷久久综合九色综合98| 久久狠狠一本精品综合网| 久久棈精品久久久久久噜噜| 久久国产色av免费看| 久久综合九色综合网站| 精品久久久无码中文字幕| 久久er热视频在这里精品| 久久亚洲精品人成综合网| 久久久久亚洲AV成人片| 久久亚洲精品无码观看不卡| 久久九九有精品国产23百花影院| 久久久久亚洲AV无码麻豆| 色综合久久无码中文字幕| 狠狠综合久久综合88亚洲| 亚洲中文久久精品无码ww16| 午夜精品久久久久久| 久久久亚洲精品蜜桃臀 | 久久午夜无码鲁丝片秋霞 | 国产精品久久久久久久久免费| 日本久久久久亚洲中字幕| 亚洲精品国产字幕久久不卡| 亚洲AV无码一区东京热久久| 国产精品一久久香蕉国产线看观看 | 精品久久久久久无码中文字幕 |