题目:
 http://acm.hdu.edu.cn/showproblem.php?pid=4438 
 
                
  2012亚洲区天津站的一道题,求期望问题,推出公式就解了,注意当Alice和Bob选择相同的时候,他们同时猎杀一只之后又同时去猎杀另一只。
  
 
   
   
 
   
 
    
   
 
 
#include <stdio.h>
int main(){
    int t;
    scanf("%d",&t);
    while(t--){
       doublex,y,p,q;
       scanf("%lf%lf%lf%lf",&x,&y,&p,&q);
       double tiger= q*p*(x+y) + (1-q)*x;
       double wolf= q*y + (1-q)*p*(x+y);
       if(tiger> wolf)
          printf("tiger %.4lf\n",tiger);
       else
          printf("wolf %.4lf\n",wolf);
    }
    return 0;
}
   
                  
                  
                  
                  
                            
      
          
                
                
                
                
              
                
                
                
                
                
              
                
                
              
            
                  
					28万+
					
被折叠的  条评论
		 为什么被折叠?
		 
		 
		
    
  
    
  
            


            