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

            superman

            聚精會(huì)神搞建設(shè) 一心一意謀發(fā)展
            posts - 190, comments - 17, trackbacks - 0, articles - 0
               :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            POJ 2183 - Bovine Math Geniuses

            Posted on 2008-06-22 09:44 superman 閱讀(293) 評(píng)論(0)  編輯 收藏 引用 所屬分類: POJ
             1 /* Accepted 588K 0MS G++ 1469B */
             2 #include <string>
             3 #include <iostream>
             4 
             5 using namespace std;
             6 
             7 int cnt[10][10][10][10][10][10];
             8 
             9 int main()
            10 {
            11     char num[6];
            12     for(int i = 0; i < 6; i++)
            13     {
            14         cin >> num[i];
            15         num[i] -= '0';
            16     }
            17     
            18     cnt[num[0]][num[1]][num[2]][num[3]][num[4]][num[5]] = 1;
            19     
            20     while(true)
            21     {
            22         int n = 0;
            23         for(int i = 1; i < 6 - 1; i++)
            24             n = n * 10 + num[i];
            25         
            26         n = n * n;
            27         
            28         char x[6];
            29         for(int i = 6 - 1; i >= 0; i--)
            30         {
            31             x[i] = n % 10;
            32             n /= 10;
            33         }
            34         
            35         if(cnt[x[0]][x[1]][x[2]][x[3]][x[4]][x[5]])
            36         {
            37             int i = 0;
            38             while(x[i] == 0 && i < 6)
            39                 i++;
            40             if(i == 6)
            41                 cout << 0;
            42             while(i < 6)
            43                 cout << int(x[i++]);
            44             
            45             int a = cnt[num[0]][num[1]][num[2]][num[3]][num[4]][num[5]] + 1;
            46             int b = cnt[x[0]][x[1]][x[2]][x[3]][x[4]][x[5]];
            47             cout << ' ' << a - b << ' ' << a - 1 << endl;
            48             break;
            49         }
            50         
            51         cnt[x[0]][x[1]][x[2]][x[3]][x[4]][x[5]]
            52          = cnt[num[0]][num[1]][num[2]][num[3]][num[4]][num[5]] + 1;
            53         
            54         for(int i = 0; i < 6; i++)
            55             num[i] = x[i];
            56     }
            57     
            58     return 0;
            59 }
            60 
            日产久久强奸免费的看| 2021少妇久久久久久久久久| 久久久久噜噜噜亚洲熟女综合| 久久国产成人午夜AV影院| 亚洲一区精品伊人久久伊人| 亚洲精品美女久久久久99| 91久久精一区二区三区大全| 97久久精品人人澡人人爽| 亚洲国产成人精品91久久久| 久久精品www人人爽人人| 久久有码中文字幕| www.久久热.com| 久久精品国产久精国产一老狼| 亚洲嫩草影院久久精品| 中文无码久久精品| 久久er国产精品免费观看8| 久久人人妻人人爽人人爽| 日本加勒比久久精品| 久久这里只有精品首页| 日韩精品久久久肉伦网站| 人人狠狠综合久久亚洲| 久久国产免费| 天天久久狠狠色综合| 精品久久人妻av中文字幕| 亚洲国产另类久久久精品小说 | 日韩精品久久久久久久电影蜜臀| 国产精品青草久久久久福利99| 亚洲国产精品无码久久久秋霞2| 久久青青草视频| 人妻精品久久久久中文字幕| 久久久久久无码国产精品中文字幕 | 久久e热在这里只有国产中文精品99| 久久中文骚妇内射| 无码人妻久久一区二区三区 | 一本一道久久综合狠狠老| 日产久久强奸免费的看| 亚洲欧洲中文日韩久久AV乱码| 国产精品成人99久久久久| 久久久精品国产亚洲成人满18免费网站 | 久久综合九色综合欧美就去吻| 久久不射电影网|