Enumerates the number of cases in which Alice throws the dice to get results.
Enumeration Bob throws the dice to get the result of the extreme number of each case.
Then enumeration Alice throws the dice to get the number of results and Bob throws the dice lower than Alice's number.
The results are then computed.
#include <iostream> #include <stdio.h> #include <string.h> #include <stdlib.h> #include < math.h> #include <ctype.h> #include <queue> #include <map> #include <algorithm>using namespace std; #define MAXN 3001#define LL long longdouble x[52][2600];d ouble y[52][2600];class fixeddicegamediv1{public : Double getexpectation (int a, int b, int c, int d) {if (a*b<c) return-1; X[0][0]=1; Y[0][0]=1; for (int i=0;i<a;i++) {for (int. j=1;j<=55;j++) {for (int k=0;k<=2500;k + +) {if (j<=b) x[i+1][k+j]+=x[i][k]; if (J<=d) y[i+1][k+j]+=y[i][k]; }}} for (int i=1;i<=2500;i++) y[c][i]+=y[c][i-1]; Double Ans,num; ans=num=0; for (int i=1;i<=2500;i++) {ans+=i*y[c][i-1]*x[a][i]; Num+=y[c][i-1]*x[a][i]; cout<<x[a][i]<< "" <<y[c][i-1]<< "" <<i<<endl; } return ans/num; }};
tc-srm-626-div1-250