• <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)  編輯 收藏 引用
            色偷偷888欧美精品久久久| 中文字幕无码av激情不卡久久| 精品久久人人做人人爽综合| 久久精品国产99国产精品澳门| 97久久超碰国产精品2021| 亚洲精品高清国产一线久久| 中文字幕人妻色偷偷久久| 久久久一本精品99久久精品66| 7777精品久久久大香线蕉 | 日本精品久久久久中文字幕8 | 久久久久亚洲AV成人网人人网站| 亚洲精品美女久久久久99小说| 日产精品久久久一区二区| 久久综合狠狠综合久久激情 | 国产精品久久久久免费a∨| 人妻久久久一区二区三区| 久久婷婷人人澡人人爽人人爱 | 精品久久久久久无码不卡| 精品水蜜桃久久久久久久| 国产精品99久久久久久宅男| 无码国内精品久久人妻蜜桃| 狠狠色丁香婷婷久久综合| 久久综合狠狠综合久久97色| 国产精品99久久久久久宅男| 精品久久久久久无码人妻热| 久久婷婷五月综合成人D啪| 久久久久这里只有精品 | 亚洲国产成人精品91久久久 | 国产69精品久久久久9999| 国产99久久久国产精免费| 日韩一区二区三区视频久久| 久久久久久久精品成人热色戒| 欧美噜噜久久久XXX| 色综合久久88色综合天天| 一级做a爰片久久毛片看看| 久久亚洲sm情趣捆绑调教 | 久久久精品人妻一区二区三区四| 国产精品久久永久免费| 99久久久精品| 色综合久久久久无码专区| 久久99亚洲综合精品首页|