• <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>
            xiaoguozi's Blog
            Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習慣原本生活的人不容易改變,就算現狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預料,人們需要更細心的觀察別人,要隨時注意才能保護別人,因為他們未必知道自己要什么·····

             http://acm.hdu.edu.cn/showproblem.php?pid=1525

             1 //題意: 給定n,m兩個數,兩個人輪流操作:
             2 //選m,n小的數,每次都是大的減去小的數的k倍,k<=max(n,m)/min(n,m);
             3 //知道其中一個為0時,執行該操作的為勝者
             4 
             5 //Analyse:for example: if n>m,then n=m*k+c(k<=n/m,c=n%m)
             6 //if k>1,then the first player can decide who'll win.if current statue is lost,he can decrease (k-1)*m,
             7 //the statue is changed to (m+c,m),the second player only operate m,so the statue is changed to (m,c) which
             8 //is the winning statue. if current is the winning statue,he can decrease k*m,the statue is changed to (m,c)
             9 //which is the lost statue.So if k>1,the one who operate it is the winner,he is active.but if k==1,he can only
            10 //operate the small one.the one who first meet k>1 is the winner.specially,if no one meet k>1,the player operate
            11 //it in turn,the first makes the n or m to zero is the winner.
            12 #include <iostream>
            13 
            14 using namespace std;
            15 int main()
            16 {
            17     int n,m;
            18     while(cin>>n>>m,n+m){
            19         int cnt=0;
            20         int ans=0;
            21         while(1){
            22             if(n<m)swap(n,m);
            23             ans=n/m;
            24             if(ans>=2){
            25                 break;
            26             }
            27             cnt++;
            28             n%=m;
            29             if(n==0){
            30                 cnt++;
            31                 break;
            32             }                
            33         }
            34         if(cnt&1){
            35             cout<<"Ollie wins\n";
            36         }
            37         else cout<<"Stan wins\n";
            38     }
            39     return 0;
            40 }
            posted on 2008-07-23 18:55 小果子 閱讀(263) 評論(0)  編輯 收藏 引用
            色偷偷91久久综合噜噜噜噜| 亚洲AV日韩AV永久无码久久 | 亚洲精品99久久久久中文字幕| 久久国产成人午夜aⅴ影院 | 色妞色综合久久夜夜| 2020久久精品国产免费| 久久夜色撩人精品国产小说| 久久综合九色综合网站| 久久久久久国产a免费观看不卡| 伊人久久精品无码二区麻豆| 国产精品青草久久久久福利99 | 狠狠狠色丁香婷婷综合久久五月 | 亚洲精品乱码久久久久久中文字幕 | 99热成人精品免费久久| 久久丫忘忧草产品| 国产AⅤ精品一区二区三区久久| 无码专区久久综合久中文字幕| 久久久久国色AV免费观看| 狠狠色丁香婷婷综合久久来 | 久久99精品久久久久久水蜜桃 | 久久福利片| 精品人妻伦九区久久AAA片69 | 伊人久久大香线蕉影院95| 久久精品国产亚洲精品2020| 狠狠色丁香婷婷久久综合| 久久久久这里只有精品| 99久久精品免费| 丁香五月综合久久激情| 亚洲狠狠久久综合一区77777| 久久精品国产亚洲AV大全| 亚洲中文字幕久久精品无码喷水 | 一本久久a久久精品综合夜夜| 久久99精品久久只有精品| 午夜天堂精品久久久久| 性做久久久久久久| 久久青青草原精品国产| 久久精品国产99国产精偷| 伊人久久大香线焦综合四虎| 久久99国产精品成人欧美| 欧美激情精品久久久久久久九九九| 国产高清美女一级a毛片久久w |