Submission #15721

#TimeUsernameProblemLanguageResultExecution timeMemory
15721cki86201최적의 능력 구성 (kriii3_C)C++98
62 / 62
405 ms13372 KiB
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> double d[1 << 20], ans; int p[22][2], n, bit[1 << 20]; int main(){ scanf("%d", &n); for (int i = 0; i < n; i++)scanf("%d%d", p[i], p[i] + 1); for (int i = 1; i < 1 << n; i++)for (int j = 0; j < n; j++)if ((1 << j) & i)bit[i]++; for (int i = 0; i < 1 << n; i++){ for (int j = 0; j < n; j++){ if (!((1 << j) & i)){ d[1 << j | i] += 1.0 / bit[1 << j | i] * (p[j][0] / 100.0 * p[j][1] + (100 - p[j][0]) / 100.0 * d[i]); } } if (ans < d[i])ans = d[i]; } printf("%.10f", ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...