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

                        }

                    }

                }


            }


             

            亚洲精品无码久久久久去q| 日日狠狠久久偷偷色综合0| 久久久久人妻一区精品性色av| 精品久久人人爽天天玩人人妻| 久久香蕉超碰97国产精品| 久久国产精品久久久| 无码国内精品久久综合88| 国产成人精品久久二区二区| 久久精品这里只有精99品| 午夜不卡久久精品无码免费| 99久久精品免费| 久久国产欧美日韩精品| 亚洲一区中文字幕久久| 久久国产免费直播| 久久久无码精品亚洲日韩软件| 亚洲AV无码成人网站久久精品大| 国产精品福利一区二区久久| 欧美精品一区二区久久| 久久精品这里热有精品| 青青草原综合久久大伊人导航| 久久99国内精品自在现线| 伊人情人综合成人久久网小说| 精品久久久久久久久中文字幕| 久久久久久国产精品美女| 久久久久久久久久久免费精品| 国产精品久久久久9999高清| 精品国产乱码久久久久久人妻| 久久九九久精品国产免费直播| 久久福利青草精品资源站免费| 亚洲国产美女精品久久久久∴| 久久午夜免费视频| 久久青青草原精品国产不卡| 狠狠色丁香婷婷综合久久来来去 | 大美女久久久久久j久久| 色综合久久久久综合体桃花网| 久久人做人爽一区二区三区 | 亚洲精品乱码久久久久久蜜桃不卡 | 国产精品久久波多野结衣| 无码伊人66久久大杳蕉网站谷歌| 波多野结衣久久一区二区| 久久久久久午夜精品|