• <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>
            隨筆 - 87  文章 - 279  trackbacks - 0
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            潛心看書(shū)研究!

            常用鏈接

            留言簿(19)

            隨筆分類(81)

            文章分類(89)

            相冊(cè)

            ACM OJ

            My friends

            搜索

            •  

            積分與排名

            • 積分 - 217774
            • 排名 - 117

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            Sailboat

            Problem H: Sailboat

            In the sailboat race, the contestant is requested to along with the prearrange path. Sailing ship's power comes from wind power and contestant's manpower. The wind power can completely used.

            In a competition, the contestants are requested to along with a 1/4 circles with radius R, the sailboat will goto east from south. During this process, the wind direction is straight from west to the east with constant speed and power.

            In order to maintain the travel direction, the athlete must adjust the sail to the vertical angle from movement direction in any time.

            If the speed of sailboat is proportional to the power at movement direction, the proportional factor is k. Supposes the wind power is f, the athlete manpower is h, please given the time of sailboat from the beginning to the end.

            Input

            The first line of each case consists of 4 double number, that is radius of path: R, wind power: f,athlete manpower: h and proportional factor:k. In order to avoid the floating point error, you needn't output the answer directly. The next line is a integer n, the following n lines gives a double value which is candidate answer.

            Output

            For each candidate of each case, Only "Yes" or "No" should be printed. Output "Yes" if the relative error to your answer is less than 3%, otherwise "No". For example, if the model answer is 100, and the candidate is 98 or 102, you should output "Yes". Output one blank line between neighboring case

            Sample Input

            1.0 2.0 1.0 1.0
            2
            0.35
            0.76
            

            Sample Output

            No
            Yes
            

            Problem Source: provided by skywind

            #include <iostream>
            #include 
            <cmath>
            using namespace std;

            const int MAXN = 100;
            const double PI = acos(-1.0);

            double R, F, H, K, ans;
            int n, cas;

            double func(double x) {
                
            return R / K / (H + F * cos(x));
            }


            double romberg(double a, double b, double EPS = 1e-6{
                
            double t[MAXN][MAXN] = {0}, tmp;
                
            int i, j, k, k2, m, m4;
                t[
            0][0= (func(a) + func(b)) * (b - a) / 2;
                k 
            = 1; k2 = 1;
                
            while (1{
                    tmp  
            = 0;
                    
            for (i = 1; i <= k2; i++{
                        tmp 
            += func(a + (2 * i - 1* (b - a) / (2 * k2));
                    }

                    t[
            0][k] = (t[0][k - 1+ tmp * (b - a) / k2) / 2;
                    
            for (m = 1, m4=4; m <= k; m++, m4 *= 4{
                        t[m][k 
            - m] = (m4 * t[m - 1][k - m + 1- t[m - 1][k - m]) / (m4 - 1);
                    }

                    
            if (fabs(t[k][0- t[k - 1][0]) < EPS) break;
                    k
            ++; k2 *= 2;
                }

                
            return t[k][0];
            }


            void solve() {
                
            double tmp;
                scanf(
            "%lf"&tmp);
                
            if (fabs(tmp - ans) / ans < 0.03) printf("Yes\n");
                
            else printf("No\n");
            }


            int main() {
                freopen(
            "2457.in""r", stdin);
                
            while (scanf("%lf%lf%lf%lf%d"&R, &F, &H, &K, &n) != EOF) {
                    
            if (cas) printf("\n");
                    
            else cas++;
                    ans 
            = romberg(0, PI/2);
                    
            while (n--{
                        solve();
                    }

                }

                
            return 0;
            }
            posted on 2007-10-20 01:02 閱讀(692) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 算法&ACM
            久久精品国产色蜜蜜麻豆| 一本大道加勒比久久综合| 久久伊人中文无码| 久久精品国产亚洲AV忘忧草18 | 久久精品国产91久久麻豆自制| 狠狠色丁香婷综合久久| 国产精品久久久99| 伊人久久大香线蕉综合Av| 国产精品久久久久9999高清| 久久精品无码av| 999久久久免费精品国产| 日本久久久久久久久久| A狠狠久久蜜臀婷色中文网| 久久久久国产成人精品亚洲午夜| 久久久无码一区二区三区| 国产精品一区二区久久精品无码 | 久久精品女人天堂AV麻| 久久国产免费直播| 婷婷久久综合| 97久久精品人人澡人人爽| 婷婷久久久亚洲欧洲日产国码AV | 国产精自产拍久久久久久蜜| 国产精品乱码久久久久久软件| 91久久福利国产成人精品| 日本久久久久亚洲中字幕| 欧美粉嫩小泬久久久久久久 | 91精品国产高清久久久久久91| 人妻无码中文久久久久专区| 中文字幕精品无码久久久久久3D日动漫| 久久不见久久见免费视频7| 99久久夜色精品国产网站| 色综合久久久久综合99| 精品熟女少妇aⅴ免费久久| 91久久精品91久久性色| 久久精品无码午夜福利理论片| A级毛片无码久久精品免费| 中文无码久久精品| 久久久无码精品亚洲日韩按摩| 久久午夜无码鲁丝片| 国产精品久久久久AV福利动漫| 2021少妇久久久久久久久久|