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

            搜索

            積分與排名

            最新隨筆

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            MiYu原創(chuàng), 轉(zhuǎn)帖請(qǐng)注明 : 轉(zhuǎn)載自 ______________白白の屋

            題目地址:
                     http://acm.hdu.edu.cn/showproblem.php?pid=2899
            題目描述:
            Strange fuction

            Time Limit: 
            2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
            Total Submission(s): 
            95    Accepted Submission(s): 75


            Problem Description
            Now, here 
            is a fuction:
              F(x) 
            = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)
            Can you find the minimum value when x 
            is between 0 and 100.
             

            Input
            The first line of the input contains an integer T(
            1<=T<=100) which means the number of test cases. Then T lines follow, each line has only one real numbers Y.(0 < Y <1e10)
             

            Output
            Just the minimum value (accurate up to 
            4 decimal places),when x is between 0 and 100.
             

            Sample Input
            2
            100
            200
             

            Sample Output
            -74.4291
            -178.8534

            題目分析:
            純數(shù)學(xué)題, 需要微積分的知識(shí)分析題目...........我承認(rèn)....我數(shù)學(xué)沒怎么學(xué)好..........
            分析出來使用2分搜索就可以了..........

            代碼如下:
            #include <iostream>
            #include 
            <cmath>
            using namespace std;
            #define POW(x) ( (x) * (x) )
            #define POW3(x) ( POW(x) * (x) )
            MiYu原創(chuàng), 轉(zhuǎn)帖請(qǐng)注明 : 轉(zhuǎn)載自 ______________白白の屋


            #define
             POW4(x) ( POW(x) * POW(x) )
            double y = 0;
            double cal ( double n )
            {
                   
            return 8.0 * POW4(n) + 7 * POW3(n) + 2 * POW(n) + 3 * n + 6 ;
            }
            int main ()
            {
                
            int T;
                scanf ( 
            "%d",&T );
                
            while ( T -- )
                {
                      scanf ( 
            "%lf",&y );
                      
            if ( cal(0> y || cal(100< y )
                      {
                           printf ( 
            "No solution!\n" );
                           
            continue;
                      }
                      
            double l = 0.0, r = 100.0,res = 0.0;
                      
            while ( r - l > 1e-6 )
                      {
                            
            double mid = ( l + r ) / 2.0;
                            res 
            = cal ( mid );
                            
            if ( res > y )
                                 r 
            = mid - 1e-6;    
                            
            else 
                                 l 
            = mid + 1e-6;
                      }
                      printf ( 
            "%.4lf\n",( l + r ) / 2.0 ); 
                }
                
            return 0
            }
            久久av高潮av无码av喷吹| 久久精品国产精品青草| 国产成人无码精品久久久性色| 色99久久久久高潮综合影院 | 999久久久无码国产精品| 久久国产精品久久精品国产| 国产精品久久久久乳精品爆| 一本色道久久综合狠狠躁| 国产精品激情综合久久| 亚洲精品高清国产一线久久| 99久久国产综合精品成人影院 | 国产亚洲欧美精品久久久 | 亚洲国产成人精品无码久久久久久综合 | 亚洲va中文字幕无码久久不卡 | 久久夜色精品国产亚洲| 一本久久久久久久| 精品综合久久久久久97| 青青青青久久精品国产h久久精品五福影院1421 | 国内精品久久久久久99蜜桃| 亚洲国产视频久久| 久久九九久精品国产| 91久久精品视频| 色综合久久精品中文字幕首页| 久久永久免费人妻精品下载| 久久精品中文字幕大胸| 无码任你躁久久久久久老妇| 久久久久久国产a免费观看不卡| 日本久久久精品中文字幕| 久久99热精品| 94久久国产乱子伦精品免费| 久久噜噜电影你懂的| 天天综合久久久网| 精品久久久久久无码免费| 久久精品中文字幕有码| 久久天天躁狠狠躁夜夜2020老熟妇 | 国产精品欧美久久久久无广告| 2020久久精品国产免费| 国产99久久精品一区二区| 久久精品国内一区二区三区| 国产午夜精品理论片久久| 国产成人精品久久综合|