zoj 1102 Phylogenetic Trees Inherited

2014-11-24 09:14:02 · 作者: · 浏览: 0

数据结构好重要啊!

先回去睡觉 明天再来解释题目。。



#include 
  
   
#include 
   
     #include 
    
      #include 
     
       #include 
      
        #include 
       
         #include 
        
          #include 
          #define inf 0x3f3f3f3f #define ll __int64 using namespace std; int ans,p[2060]; char c,s[1030][1030]; int main() { int i,j,n,l; while(scanf("%d%d",&n,&l)&&(n||l)) { for(i=0;i
          
           0;j--) { if(!(p[j+j]&p[j+j+1])) { ans++; p[j]=(p[j+j]|p[j+j+1]); } else p[j]=(p[j+j]&p[j+j+1]); } c='A'; while(p[1]>>=1) c++; putchar(c); } printf(" %d\n",ans); } return 0; }