• <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亚洲国产成人久久精品| 欧美无乱码久久久免费午夜一区二区三区中文字幕| 性欧美大战久久久久久久久 | 久久午夜免费视频| 久久久久波多野结衣高潮| 国产精品欧美久久久天天影视| 国产福利电影一区二区三区久久老子无码午夜伦不 | 91精品国产高清久久久久久国产嫩草 | 亚洲国产一成人久久精品| 久久噜噜电影你懂的| 亚洲国产一成久久精品国产成人综合| 久久丫精品国产亚洲av| 国内精品久久久久久久coent| 香蕉久久夜色精品升级完成| 久久激情亚洲精品无码?V| 人妻精品久久久久中文字幕69 | 久久久久成人精品无码 | 久久久久人妻一区精品性色av| 久久久精品波多野结衣| 成人久久综合网| 久久久久久久久久久精品尤物| 久久久久久A亚洲欧洲AV冫| 国产精品久久久久aaaa| 久久天天躁狠狠躁夜夜网站| 思思久久99热只有频精品66| 久久久久亚洲AV无码去区首| 国产激情久久久久影院老熟女免费| 久久久久久午夜成人影院| 97久久婷婷五月综合色d啪蜜芽 | 国产精品视频久久| 97精品伊人久久大香线蕉app| 中文国产成人精品久久不卡| 伊人情人综合成人久久网小说| 久久久综合香蕉尹人综合网| 久久久噜噜噜久久中文字幕色伊伊| 国产成人精品久久亚洲| 国产香蕉97碰碰久久人人| 久久午夜无码鲁丝片午夜精品| 久久免费大片| 亚洲精品国精品久久99热一|