#include using namespace std; #define Real double #define EPS (Real)(1e-12) #define MAX_H 11 #define MAX_W 11 int h,w; Real p[MAX_H][MAX_W]; int s[MAX_H][MAX_W]; Real result; Real raised[MAX_H+1][1<>j & 1 == 1){ rate *= p[i][j]; know[j] = true; }else{ rate *= (1.0-p[i][j]); know[j] = false; } if(rate>j&1==1); if(j>=1 && active[j]>=3 && raisings[j-1]){ raisings[j] = true; }else if(active[j]>=4){ raisings[j] = true; } } // from front & right for(int j=w-2;j>=0;--j){ if(!know[j])continue; if( !raisings[j] && active[j]>=3 && raisings[j+1] ){ raisings[j] = true; } } // from front & left & right for(int j=1;j=2 && raisings[j-1] && raisings[j+1] ){ raisings[j] = true; } } raising = 0; for(int j=0;j