# Dreamoon and WiFi（组合数学）

## 题目大意

c(n,0)(n+(-1)0)+c(n,1)(n-1+(-1)1)+c(n,i)(n-i+(-1)i)+...+c(n,n)(n-n+(-1)n)

  1 2 3 4 5 6 7 8 9 10 11  //cf 错误报告，思前恐后不晓得 why,wtf??? 先码着吧 Test: #2, time: 0 ms., memory: 0 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER Input +-+- +-?? Output -0.000000000000 Answer 0.500000000000 Checker Log wrong answer 1st numbers differ - expected: '0.5000000', found: '-0.0000000', error = '0.5000000'

## 错误代码

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42  #include using namespace std; int main(){ int i,j,cnt=0; long long c[11][11],sum=0,sum1=0; for(i = 0; i < 11; i++){//杨辉三角 c[i][0] = 1; c[i][i] = 1; for(j = 1; j < i; j++) c[i][j] = c[i-1][j] + c[i-1][j-1]; } string a,b; cin>>a>>b; //cout<

## AC 代码

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36  #include using namespace std; int main(){ string a,b; int x,y,z,p,q,c[11][11],i,j; for(i = 0; i < 11; i++){ c[i][0] = 1; c[i][i] = 1; for(j = 1; j < i; j++) c[i][j] = c[i-1][j] + c[i-1][j-1]; } cin>>a; cin>>b; x=y=z=p=q=0; for(i=0;i