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

            T9的空間

            You will never walk alone!

              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              69 隨筆 :: 0 文章 :: 28 評論 :: 0 Trackbacks

            #

                 摘要: 用了STL_algorithm中的permution,很好很強(qiáng)大!  閱讀全文
            posted @ 2008-10-22 17:25 Torres 閱讀(635) | 評論 (1)編輯 收藏

                 摘要: 自己寫了一個,不過貼一個Waterloo的標(biāo)程,突然喜歡上這種風(fēng)格了,求最短路的!  閱讀全文
            posted @ 2008-10-20 22:25 Torres 閱讀(272) | 評論 (0)編輯 收藏

                 摘要: wa的不行,改了又改,亂套了,最后重寫ac了!  閱讀全文
            posted @ 2008-10-20 22:18 Torres 閱讀(352) | 評論 (0)編輯 收藏

            //基于AOV(activity on vertex)網(wǎng)絡(luò)的拓?fù)渑判?/span>

            #include
            <iostream>
            #include
            <string>
            #include
            <algorithm>
            #include
            <vector>
            using namespace std;

            #define VN 20
            vector
            <int> p[VN]; 
            int de[VN];

            int main()
            {
                
            int i,j,s,e;
                
            int n;
                
            int re[VN];
                memset(de,
            0,sizeof(de));
                freopen(
            "in.txt","r",stdin);
                scanf(
            "%d",&n);
                
            while(scanf("%d%d",&s,&e))
                
            {
                    
            if(s==0&&e==0break;
                    p[s].push_back(e);
                    de[e]
            ++;
                }

                
            int k=0;
                
            int flag;
                
            for(i=1;i<=n;i++)
                
            {
                    flag
            =0;
                    
            for(j=1;j<=n;j++)
                        
            if(de[j]==0
                        
            {
                            re[k
            ++]=j;
                            
            int len=p[j].size();
                            
            for(int t=0;t<len;t++)
                                de[p[j][t]]
            --;
                            de[j]
            =-1;
                            flag
            =1;
                            
            break;
                        }

                    
            if(!flag) break;
                }

                
            if(k<n) printf("Can't do it\n");
                
            else
                
            {
                    
            for(i=0;i<n;i++)
                        printf(
            "%d ",re[i]);
                    printf(
            "\n");
                }

                
            return 0;
            }

            測試結(jié)果:
            8
            2 1
            3 2
            2 4
            5 4
            7 8
            1 8
            8 3
            3 6
            4 8
            4 6
            0 0
            Can't do it

            8
            2 1
            2 3
            2 4
            5 4
            7 8
            1 8
            3 8
            3 6
            4 8
            4 6
            0 0
            2 1 3 5 4 6 7 8

            posted @ 2008-10-19 10:45 Torres 閱讀(269) | 評論 (0)編輯 收藏

                 摘要: 很久以前做得題,感覺很huffman  閱讀全文
            posted @ 2008-10-16 21:23 Torres 閱讀(318) | 評論 (0)編輯 收藏

                 摘要: 幾何題,高中數(shù)學(xué),告誡自己細(xì)心一點兒,耐心一點兒!  閱讀全文
            posted @ 2008-09-24 21:29 Torres 閱讀(239) | 評論 (0)編輯 收藏

            我就叫他射線法吧
            基本步驟:

            1,過p點垂直向上作一條射線

            2,判斷此射線與n邊形n條邊的交點

            3,把所有交點相加,如果是奇數(shù)則說明在多邊形內(nèi),否則在多邊形外

            思路非常的簡單,另外說明一下幾種特殊的情況:

            1,射線與多邊形的頂點相交;比如射線過多邊形的Pi點,則如果Pi-1和Pi+1在此射線的異側(cè),此交點可以算一個,如果此兩點在射線的同側(cè),則此交點不計。此結(jié)論非常簡單,畫個圖應(yīng)該就能明白了

            2,p點在多邊形的某一條邊上;也認(rèn)為p在多邊形中

            3,p不在多邊形的邊上,但p的射線與多邊形的某一條邊重合;比如與Pi,Pi+1線段重合,則如果Pi-1和Pi+2在射線的兩側(cè),此情況也算一個交點,否則此情況不計交點

            posted @ 2008-09-23 20:51 Torres 閱讀(525) | 評論 (0)編輯 收藏

                 摘要: The first SPFA  閱讀全文
            posted @ 2008-09-12 11:17 Torres 閱讀(509) | 評論 (0)編輯 收藏

                 摘要: 網(wǎng)上看到的spfa的實現(xiàn),很清晰。Orz~~ #include <cstdio>#include <cstring>const int maxn = 10000+1;const int maxnm = 100000+1;class node { ...  閱讀全文
            posted @ 2008-09-11 17:01 Torres 閱讀(1091) | 評論 (2)編輯 收藏

            這里有對全排列函數(shù)permutation的介紹http://hi.baidu.com/sunshine_0316/blog/item/6f87a044bf30f320cffca381.html
            #include<iostream>
            #include
            <map>
            #include
            <algorithm>

            using namespace std;

            typedef 
            struct node
            {
                
            char ch;
                
            int flag;
            }
            node;

            bool cmp(const node a,const node b)
            {
                
            return a.flag<b.flag;
            }


            int main()
            {
                
            int cas,i;
                
            char str[15],ch;
                map
            <char,int> mp;
                
            for(ch='A',i=1;ch<='Z';ch++,i=i+2) mp[ch]=i;
                
            for(ch='a',i=2;ch<='z';ch++,i=i+2) mp[ch]=i;
                scanf(
            "%d",&cas);
                
            while(cas--)
                
            {
                    scanf(
            "%s",str);
                    
            int len=strlen(str);
                    node p[
            15];
                    
            for(i=0;i<len;i++)
                    
            {
                        p[i].ch
            =str[i];
                        p[i].flag
            =mp[str[i]];
                    }

                    sort(p,p
            +len,cmp);
                    
            do
                    
            {
                        
            for(i=0;i<len;i++)
                            printf(
            "%c",p[i].ch);
                        printf(
            "\n");
                    }
            while(next_permutation(p,p+len,cmp));
                }

                
            return 0;
            }


            posted @ 2008-09-10 11:32 Torres 閱讀(997) | 評論 (0)編輯 收藏

            僅列出標(biāo)題
            共7頁: 1 2 3 4 5 6 7 
            久久久久久久久波多野高潮| 久久精品久久久久观看99水蜜桃| 久久久久亚洲AV无码麻豆| 欧美黑人又粗又大久久久| 2020久久精品国产免费| 久久久久国产一区二区三区| 精品国产乱码久久久久久呢| 国产欧美一区二区久久| 亚洲午夜精品久久久久久浪潮| 久久久无码人妻精品无码| 91性高湖久久久久| 人妻少妇久久中文字幕一区二区 | 亚洲人成无码www久久久| 一本久道久久综合狠狠爱| 国产综合免费精品久久久| 久久久久久久人妻无码中文字幕爆| 99久久免费只有精品国产| 漂亮人妻被黑人久久精品| 久久这里有精品视频| 丁香狠狠色婷婷久久综合| 77777亚洲午夜久久多人| 久久久久国产精品嫩草影院 | 亚洲狠狠婷婷综合久久久久| 国产福利电影一区二区三区久久久久成人精品综合 | 国产成人精品综合久久久| 久久久久99精品成人片牛牛影视| 中文精品久久久久国产网址| 久久永久免费人妻精品下载| 久久九九兔免费精品6| 日韩精品无码久久一区二区三| 亚洲国产成人久久综合碰碰动漫3d| 亚洲va中文字幕无码久久不卡 | 色综合久久综精品| 国产精品久久永久免费| 97热久久免费频精品99| 97r久久精品国产99国产精| 丰满少妇高潮惨叫久久久| 无码国内精品久久人妻| 嫩草伊人久久精品少妇AV| 国产精品美女久久久久久2018| 久久av无码专区亚洲av桃花岛|