• <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://www.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 );

                        }

                    }

                }


            }


             

            国产成人精品久久亚洲| 亚洲国产精品无码久久| 一本大道久久a久久精品综合| 久久香蕉国产线看观看99 | 久久99国产精品久久99小说| 亚洲国产另类久久久精品| 久久久久综合网久久| 欧美性猛交xxxx免费看久久久| 蜜桃麻豆WWW久久囤产精品| 久久久九九有精品国产| 久久久久久精品成人免费图片 | 久久精品国产国产精品四凭| 久久午夜福利无码1000合集| 91精品国产高清久久久久久io| 日韩va亚洲va欧美va久久| 波多野结衣中文字幕久久 | 精品久久一区二区三区| 亚洲一区精品伊人久久伊人| 国产精品一久久香蕉国产线看| 青青久久精品国产免费看| 91精品免费久久久久久久久| 亚洲乱码中文字幕久久孕妇黑人 | 久久久久亚洲AV成人网人人网站| 一本伊大人香蕉久久网手机| 亚洲精品乱码久久久久久久久久久久 | 97久久久精品综合88久久| 伊人久久大香线焦AV综合影院 | 国产欧美一区二区久久| 99久久国产宗和精品1上映 | 漂亮人妻被中出中文字幕久久| 2020最新久久久视精品爱| 久久99精品国产麻豆| 亚洲中文字幕久久精品无码喷水| 看全色黄大色大片免费久久久 | 欧美大战日韩91综合一区婷婷久久青草| 久久精品国产精品亚洲毛片 | 久久国产热这里只有精品| 91精品国产91久久久久久| 久久久久久久尹人综合网亚洲| 国产精品久久久福利| 2021精品国产综合久久|