• <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>
            隨筆-72  評論-126  文章-0  trackbacks-0
            http://acm.hdu.edu.cn/showproblem.php?pid=1199

            #include<stdio.h>
            #include
            <stdlib.h>
            //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
            struct H{
                
            int start,end;
            }hh[
            100001];
            int k;
            //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
            int cmp(const void *a,const void *b)
            {
                
            struct H *= (struct H *)a;
                
            struct H *= (struct H *)b;
                
            return c->start - d->start;
            }
            void White()
            {
                
            int i;
                qsort(hh,k,
            sizeof(hh[0]),cmp);
                
            for(i=1;i<k;i++)
                    
            if(hh[i-1].start+1 && hh[i-1].end >= hh[i].start)
                    {
                        hh[i].start 
            = hh[i-1].start;
                        
            if(hh[i-1].end>hh[i].end)
                            hh[i].end 
            = hh[i-1].end;
                    }
            }
            void Black(int a,int b)
            {
                
            int i;
                
            for(i=0;i<k;i++)
                {
                    
            if(hh[i].start+1)
                    {
                        
            if(hh[i].start < a && b< hh[i].end)
                        {
                            hh[k].end
            =hh[i].end;
                            hh[k].start
            =b+1;
                            hh[i].end
            =a-1;
                            k
            ++;
                            
            continue;
                        }
                        
            if(hh[i].start<=&& b<hh[i].end)
                        {
                            hh[i].start
            =b+1;
                            
            continue;
                        }
                        
            if(hh[i].start<&& a<= hh[i].end)
                        {
                            hh[i].end
            =a-1;
                            
            continue;
                        }
                        
            if(a<=hh[i].start && hh[i].end<=b)
                        {
                            hh[i].start
            =-1;
                            hh[i].end
            =-1;
                            
            continue;
                        }
                    }
                }
            }
            //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
            int main()
            {
                
            int T,a,b,max;
                
            char com[2];
                
            while(scanf("%d",&T)==1)
                {
                    k 
            = 0;
                    
            while(T--)
                    {
                        scanf(
            "%d%d%s",&a,&b,com);
                        
            if(a>b)
                            a
            ^=b^=a^=b;
                        
            if(com[0]=='w')
                        {
                            hh[k].start 
            = a;
                            hh[k].end 
            = b;
                            k 
            ++;
                        }
                        
            else
                        {
                            Black(a,b);
                        }
                    }
                    White();
                    max 
            = 0;
                    
            int j;
                    
            for(int i=0;i<k;i++)
                    {
                        
            if(hh[i].start!=-1)
                        {
                            
            int x = hh[i].end - hh[i].start + 1;
                            
            if(x>max)
                            {
                                max 
            = x;
                                j 
            = i;
                            }
                        }
                    }
                    
            if(max)
                        printf(
            "%d %d\n",hh[j].start,hh[j].end);
                    
            else
                        puts(
            "Oh, my god");
                }
                
            return 0;
            }


            這些是二維的:
            http://acm.hdu.edu.cn/showproblem.php?pid=1543
            http://acm.hdu.edu.cn/showproblem.php?pid=1542
            http://acm.hdu.edu.cn/showproblem.php?pid=2704
            http://acm.hdu.edu.cn/showproblem.php?pid=1255
            posted on 2009-03-28 18:54 shǎ崽 閱讀(565) 評論(0)  編輯 收藏 引用
            91亚洲国产成人久久精品| 久久99热这里只有精品66| 一本色道久久88加勒比—综合| 国产精品久久久久久久午夜片| 亚洲伊人久久综合中文成人网| 久久精品麻豆日日躁夜夜躁| 九九久久精品无码专区| 蜜臀久久99精品久久久久久小说| 91精品国产色综久久| 少妇人妻综合久久中文字幕| 久久精品国产一区二区三区日韩| 久久久精品久久久久影院| 99久久伊人精品综合观看| 久久久久99精品成人片欧美| 久久露脸国产精品| 青青青伊人色综合久久| 久久久久亚洲AV成人片 | 97精品依人久久久大香线蕉97| 亚洲狠狠综合久久| 久久久久免费看成人影片| 97精品国产97久久久久久免费| 色欲综合久久躁天天躁| 精品久久久久久无码国产| 久久亚洲高清观看| 999久久久免费精品国产| 久久亚洲精精品中文字幕| 久久精品中文字幕一区| 久久久久亚洲精品日久生情| 亚洲国产精品综合久久一线| 久久伊人五月天论坛| 热RE99久久精品国产66热| 久久激情亚洲精品无码?V| 久久99精品国产99久久6| 久久精品亚洲乱码伦伦中文| 久久久亚洲精品蜜桃臀| 无码任你躁久久久久久久| 一本色道久久综合狠狠躁篇| 少妇被又大又粗又爽毛片久久黑人| 亚洲国产精品久久| 久久久久久毛片免费看| 久久精品中文字幕一区|