## Sol

/*

*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<cmath>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
#define Pair pair<int, int>
#define MP(x, y) make_pair(x, y)
#define fi first
#define se second
#define int long long
#define LL long long
#define ull unsigned long long
#define rg register
#define pt(x) printf("%d ", x);
//#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1<<22, stdin), p1 == p2) ? EOF : *p1++)
//char buf[(1 << 22)], *p1 = buf, *p2 = buf;
//char obuf[1<<24], *O = obuf;
//void print(int x) {if(x > 9) print(x / 10); *O++ = x % 10 + '0';}
//#define OS  *O++ = ' ';
using namespace std;
//using namespace __gnu_pbds;
const int MAXN = 1e6 + 10, INF = 1e9 + 10, mod = 1e9 + 7;
const double eps = 1e-9;
char c = getchar(); int x = 0, f = 1;
while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
return x * f;
}
double a, b, c;
double f[101][101][101];
double calca(int a, int b, int c) {
if(f[a][b][c]) return f[a][b][c];
if(a == 0) return f[a][b][c] = 0;
if(a && (!b) && (!c)) return f[a][b][c] = 1;
double down = a * b + b * c + a * c, ans = 0;
if(a && b) ans += (double) a * b / down * calca(a, b - 1, c);
if(b && c) ans += (double) b * c / down * calca(a, b, c - 1);
if(a && c) ans += (double) a * c / down * calca(a - 1, b, c);
return f[a][b][c] = ans;
}
double calcb(int a, int b, int c) {
if(b == 0) return f[a][b][c] = 0;
if((!a) && b && (!c)) return f[a][b][c] = 1;
if(f[a][b][c]) return f[a][b][c];
double down = a * b + b * c + a * c, ans = 0;
if(a && b) ans += (double) a * b / down * calcb(a, b - 1, c);
if(b && c) ans += (double) b * c / down * calcb(a, b, c - 1);
if(a && c) ans += (double) a * c / down * calcb(a - 1, b, c);
return f[a][b][c] = ans;
}
main() {
double a1 = 0, a2 = 0;
printf("%.10lf ", a1 = calca(a, b, c)); memset(f, 0, sizeof(f));
printf("%.10lf ", a2 = calcb(a, b, c));
printf("%.10lf", 1 - a1 - a2);
return 0;
}
/*
2 2 1
1 1
2 1 1
*/

1811 篇文章123 人订阅

0 条评论

## 相关文章

1.1K60

77270

10510

### 透过WebGL 3D看动画Easing函数本质

50年前的这个月诞生了BASIC这门计算机语言，回想起自己喜欢上图形界面这行，还得归功于当年在win98下用QBASIC照葫芦画瓢敲了一段绘制奥运五环的代码，当...

224100

34360

### 透过HT for Web 3D看动画Easing函数本质

http://www.hightopo.com/guide/guide/plugin/form/examples/example_easing.html 50年...

22960

46450

54780

52670

20110