ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

ZOJ3864:Quiz for EXO-L(BFS)(¶þ)
2015-11-21 01:05:00 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:6´Î
Tags£ºZOJ3864:Quiz for EXO-L BFS
0 52 6 3 6 15 17 53 7 2 5 19 15 49 10 2 5 21 16 44 12 2 4 24 17 38 12 6 3 25 18 34 12 6 4 26 7 1 13 31 9 7 6 25 7 5 10 34 4 6 9 25 7 8 5 46 8 25 8 58 9 25 7 59 8 25 8 59 8 25 7 48 4 7 8 26 7 8 2 35 9 5 8 25 6 7 7 33 11 3 8 25 4 6 11 35 18 25 3 5 15 36 16 25 3 3 15 40 17 21 4 2 14 44 17 19 5 2 10 49 17 16 6 2 8 51 20 13 6 2 6 52 23 11 7 2 4 53 5 2 18 8 8 2 5 51 6 5 8 2 7 6 7 3 5 51 5 8 4 5 9 2 8 4 4 50 6 17 18 5 5 49 5 13 3 2 18 5 5 48 6 11 5 3 16 7 5 47 6 9 8 2 16 7 5 47 5 7 11 3 14 9 4 46 3 8 14 4 13 9 4 45 1 8 16 6 14 8 2 54 16 9 13 62 9 3 5 8 15 60 6 6 5 8 16 58 5 9 5 7 5 2 9 58 2 12 5 6 6 5 7 72 5 5 5 8 5 72 5 4 6 11 2 73 3 5 5 87 3 5 5 87 3 5 4 89 1 6 4 97 3 97 2 98 2 1445
100 451
1449 2 96 4 96 5 94 6 93 6 94 5 93 6 93 6 10 4 78 7 7 13 72 6 6 18 80 21 62 2 14 24 58 3 14 26 55 3 13 15 6 8 54 4 10 20 8 5 51 5 8 25 8 3 51 4 7 29 7 3 49 5 6 31 7 2 48 5 6 15 4 14 7 1 48 5 5 15 9 11 54 6 4 15 12 10 53 5 4 16 14 8 53 5 3 16 16 8 51 6 3 8 1 6 18 8 50 6 2 8 2 6 19 7 50 6 2 7 3 5 7 21 5 1 43 6 1 7 4 5 4 24 4 2 43 6 1 7 4 5 2 26 4 3 43 12 4 5 2 28 3 3 43 12 4 5 16 14 3 4 42 11 5 5 19 12 3 4 42 10 5 5 15 1 5 10 3 5 41 10 6 3 16 1 7 8 4 5 40 9 7 3 16 2 7 8 3 7 32 1 6 8 7 3 16 2 8 7 4 7 29 5 4 8 7 3 16 3 7 8 4 6 29 6 4 7 7 3 16 3 8 7 5 5 29 7 3 8 7 2 16 3 8 8 5 3 31 6 4 8 6 2 16 4 7 8 40 6 4 8 6 1 16 4 6 10 40 6 3 9 6 1 15 4 6 10 42 4 3 11 20 4 6 10 42 4 4 12 18 4 6 11 42 3 4 15 15 4 5 12 43 2 4 26 3 5 5 12 43 2 4 25 4 5 4 6 1 6 44 1 5 6 2 14 6 5 4 6 1 6 44 1 5 7 5 6 9 6 3 7 1 6 50 8 19 6 2 7 2 6 51 8 18 6 1 7 3 6 51 9 16 15 3 6 52 10 13 15 4 5 54 11 11 14 5 5 47 1 6 14 6 15 6 4 49 1 6 33 6 5 49 2 6 31 7 4 50 3 7 27 8 4 52 4 6 25 9 3 53 6 7 20 10 3 55 29 12 2 57 26 14 1 60 23 78 20 6 5 71 15 7 8 72 10 8 7 92 7 92 6 93 6 94 6 94 5 95 4 97 2 1448

Sample Output

Xiumin
Sehun

Hint

The images in the sample input are visualized as:

?

Sample 1 Sample 2
Sample 1
Sample 2
?
?
?
ÆäʵÕâµÀÌâ²¢²»ÄÑ£¬µ«ÊǾÍÊÇÌâÒâÏäµ¥ÄÑÀí½â£¬ÎÒÒ»¿´µ½ÕâµÀÌâµÄµÚÒ»¸Ð¾õ¾ÍÊǸúHDU3839ÄǸöÌâÓеãÏñ£¬ºóÀ´Ò»ÊÔȷʵÈç´Ë£¬¾ÍÊÇ¿´»¯³É¶þ½øÖƺóµÄ°×É«¿éÊýÁ¿ÓëºÖÉ«¿éÊýÁ¿ÓëÉÏÃæÍ¼ÐÎÖÐÄĸö¸¾Ó¤¶øÒÑ£¬Òª×¢Ò⣬¶ÔÓÚ×îÍâ²ãµÄ°×É«¿éÊDz»¼ÆËãÔÚÄڵģ¬ÎÒÃÇÒª¼ÆËãµÄÊDZ»ºÚÉ«¿ì°üΧµÄ°×É«¿éµÄÊýÁ¿
?
?
#include 
       
        
#include 
        
          #include 
         
           #include 
          
            #include 
           
             #include
             #include 
             
               #include 
              
                #include 
               
                 #include 
                
                  using namespace std; #define ls 2*i #define rs 2*i+1 #define up(i,x,y) for(i=x;i<=y;i++) #define down(i,x,y) for(i=x;i>=y;i--) #define mem(a,x) memset(a,x,sizeof(a)) #define w(a) while(a) #define LL long long const double pi = acos(-1.0); #define Len 1000005 #define mod 998244353 struct Point { int x,y; }; int t,n,m,lx,ly,x,y; int vis[1005][1005],mat[1005][1005]; int to[8][2] = {1,0,0,1,-1,0,0,-1,1,1,1,-1,-1,1,-1,-1}; int bfs(int x,int y,int k) { int i,j; queue
                 
                   Q; Point a,next; a.x = x; a.y = y; vis[x][y] = 1; int cnt = 1; Q.push(a); w(!Q.empty()) { a = Q.front(); Q.pop(); up(i,0,7) { next.x = a.x+to[i][0]; next.y = a.y+to[i][1]; if(next.x>=0 && next.x
                  
                   =0 && next.y
                   
                     black,white; up(i,0,n-1) { up(j,0,n-1) { if(!vis[i][j]) { if(!mat[i][j]) white.push_back(bfs(i,j,0)); else black.push_back(bfs(i,j,1)); } } } int bcnt = black.size(),wcnt = white.size(); if(bcnt==1) { if(wcnt==1) puts("D.O"); else if(wcnt==2) puts("Chen"); } else if(bcnt==2) { if(wcnt==12) puts("Kai"); else if(wcnt==7) puts("Suho"); else if(wcnt==3) puts("Tao"); } else if(bcnt==3) { if(wcnt==0) puts("Kris"); } else if(bcnt==5) { if(wcnt==0) puts("Chanyeol"); else if(wcnt==7) puts("Luhan"); else if(wcnt==1) { sort(black.begin(),black.end()); int sum=black[0]+black[1]+black[2]+black[3]; double tem=(double)sum/black[4]; if(tem<0.4) puts("Sehun"); else puts("Xiumin"); } } else if(bcnt==6) { if(wcnt==1) puts("Lay"); } else if(bcnt==9) { if(wcnt==1) puts("Baekhyun"); } } return 0; } 
                   
                  
                 
                
               
              
             
           
          
         
        
       

?
?
?
?

?

?

Ê×Ò³ ÉÏÒ»Ò³ 1 2 ÏÂÒ»Ò³ βҳ 2/2/2
¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºLeetCode¨DReverse Bits £¬1 Bitº.. ÏÂһƪ£ºleetcode-18 4Sum

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ: