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

            聚精會神搞建設 一心一意謀發展
            posts - 190, comments - 17, trackbacks - 0, articles - 0
               :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            ZOJ 1073 - Round and Round We Go

            Posted on 2008-04-01 13:48 superman 閱讀(229) 評論(0)  編輯 收藏 引用 所屬分類: ZOJ
             1 /* Accepted 1073 C++ 00:00.02 848K */
             2 #include <string>
             3 #include <iostream>
             4 
             5 using namespace std;
             6 
             7 int main()
             8 {
             9     string s;
            10     while(cin >> s)
            11     {
            12         int n = s.size();
            13         bool cyclic = true;
            14         for(int k = 2; k <= n; k++)
            15         {
            16             int c[200= {0};
            17             for(int i = n; i > 0; i--)
            18             {
            19                 c[i]     += (s[i - 1- '0'* k;
            20                 c[i - 1+= c[i] / 10;
            21                 c[i]     %= 10;
            22             }
            23             
            24             if(c[0])
            25             {
            26                 cyclic = false;
            27                 break;
            28             }
            29             
            30             string cur;
            31             for(int i = 1; i <= n; i++)
            32                 cur += (c[i] + '0');
            33             
            34             int pos = 0;
            35             while(true)
            36             {
            37                 pos = cur.find(s[0], pos);
            38                 if(pos == string::npos)
            39                 {
            40                     cyclic = false;
            41                     break;
            42                 }
            43                 
            44                 string tmp;
            45                 for(int i = pos; i < n; i++)
            46                     tmp += cur[i];
            47                 for(int i = 0; i < pos; i++)
            48                     tmp += cur[i];
            49                 
            50                 if(tmp == s)
            51                     break;
            52                 
            53                 pos++;
            54             }
            55         }
            56         if(cyclic)
            57             cout << s << " is cyclic" << endl;
            58         else
            59             cout << s << " is not cyclic" << endl;
            60     }
            61     
            62     return 0;
            63 }
            64 
            久久91综合国产91久久精品| 久久成人小视频| 91精品国产91久久久久久青草| 丰满少妇人妻久久久久久4| 久久综合九色综合欧美就去吻| 2021国产精品久久精品| 99久久超碰中文字幕伊人| 久久99国产精品成人欧美| 亚洲AV无码一区东京热久久| 99久久精品免费观看国产| 狠狠色综合网站久久久久久久高清| 久久精品国产精品亚洲精品| 免费一级做a爰片久久毛片潮| 日本人妻丰满熟妇久久久久久| 久久国产免费直播| 99精品国产在热久久无毒不卡| 思思久久99热只有频精品66| 热久久这里只有精品| 亚洲午夜久久久久久久久电影网| 99久久国产免费福利| 久久精品中文字幕无码绿巨人| 无码人妻少妇久久中文字幕| 中文字幕亚洲综合久久2| 久久精品人人槡人妻人人玩AV| 国产精品久久久久久久人人看| 国产AV影片久久久久久| 久久香蕉国产线看观看乱码| 亚洲va久久久噜噜噜久久男同 | 久久久婷婷五月亚洲97号色| 久久久国产精品| 久久天天躁狠狠躁夜夜av浪潮| 国产精品免费久久| 久久99精品国产麻豆蜜芽| 99热成人精品免费久久| 国产精品成人久久久久三级午夜电影| 蜜臀av性久久久久蜜臀aⅴ麻豆| 久久伊人精品一区二区三区| 99久久做夜夜爱天天做精品| 国产成人无码精品久久久性色 | 精品久久久久久中文字幕大豆网| 久久久久久噜噜精品免费直播|