• <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年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(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 );

                        }

                    }

                }


            }


             

            jizzjizz国产精品久久| 久久久久久久97| 久久露脸国产精品| 精品国产日韩久久亚洲| 国产亚洲精久久久久久无码| 久久精品无码一区二区无码| 久久精品国产精品亚洲下载| 久久婷婷五月综合97色直播| 狠狠色婷婷综合天天久久丁香| 久久久青草青青国产亚洲免观| 亚洲午夜久久久久久久久久| 成人午夜精品久久久久久久小说| 精品久久久一二三区| 久久精品国产只有精品2020| 要久久爱在线免费观看| 色成年激情久久综合| 久久无码中文字幕东京热| 亚洲国产成人久久综合一 | 亚洲国产一成人久久精品| 韩国三级大全久久网站| 久久精品日日躁夜夜躁欧美 | 深夜久久AAAAA级毛片免费看| 色88久久久久高潮综合影院| 久久久久99精品成人片| 久久精品国产亚洲综合色| 久久婷婷五月综合色高清| 久久伊人精品一区二区三区| 久久精品国产一区二区电影| 久久精品这里热有精品| 国产产无码乱码精品久久鸭| 伊人久久大香线焦AV综合影院| 久久久黄片| 久久本道综合久久伊人| www亚洲欲色成人久久精品| 国产欧美一区二区久久| 99久久免费国产精精品| 久久久亚洲欧洲日产国码aⅴ| 伊人久久无码中文字幕| 久久精品中文騷妇女内射| 亚洲日韩中文无码久久| 久久综合给合久久狠狠狠97色69|