Title Link: Card Game (First Edition)
Exercises
Emmmmmm, the match time and teammate scratching also did not write out, sure enough his math in the college entrance examination and returned to the teacher.
The first thing I always wanted was expectation = 1* (probability of getting one point) + (probability of getting two points) + (probability of getting three points) + .... + N (probability of N);
Of course, this practice did not come out.
In fact, should think so, two people each round from the card heap each draw 1 cards, each round fat win probability is 1/2, because each draw two cards, the first card than the second card big probability is 1/2. It is said that each round of fat win the same probability is 1/2, so can expect = 1* (*n) = N/2;
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 10000100;
BOOL VIS[MAXN];
int main ()
{
int caset,cas=0;scanf ("%d", &caset);
while (caset--)
{
int n;scanf ("%d", &n);
for (int i=0,x;i<2*n;i++)
scanf ("%d", &x);
printf ("Case%d:%.2f\n", ++CAS,1.0*N/2);
}
return 0;
}