#include <bits/stdc++.h> #define llong long long using namespace std; const int N = 1e5; const int P = 1e9+; const llong INV2 = 5e8+; int nxt[N+]; int lstpos[N+]; int a[N+]; int num[N+]; int cnum[N+]; llong tmp0[N+],tmp1[N+],tmp2[N+]; vector<int&…
http://codeforces.com/problemset/problem/148/D 题意:w个白b个黑,公主和龙轮流取,公主先取,等概率取到一个.当龙取完后,会等概率跳出一只.(0<=w, b<=1000) #include <bits/stdc++.h> using namespace std; int n, m; const int N=1005; double d[N][N][2]; int main() { scanf("%d%d", &…