O(...)
#include<cstdio> #include<math.h> const int p[] = { 0,1,4,6,8,9,10,12,14,15,16,18 }; int c[19][19], a, b; double f(double x) { double s = 0; for (int i = 0; i < 12; i++) s += c[18][p[i]] * pow(x, p[i])*pow(1 - x, 18 - p[i]); return s; } int main() { scanf("%d%d", &a, &b); for (int i = 0; i < 19; i++) { c[i][0] = 1; for (int j = 1; j <= i; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j]; } printf("%lf", 1 - f(a / 100.0)*f(b / 100.0)); return 0; }
댓글 없음 :
댓글 쓰기