Submission #15311

#TimeUsernameProblemLanguageResultExecution timeMemory
15311xhae최적의 능력 구성 (kriii3_C)C++14
62 / 62
107 ms9916 KiB
#include <math.h> #include <stdio.h> #include <string.h> #include <vector> #include <string> #include <queue> #include <map> #include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <sstream> #include <set> using namespace std; int main() { int N; cin >> N; vector<int> p(N), d(N); for (int i=0; i<N; i++) cin >> p[i] >> d[i]; vector<double> res(1<<N); double ret = 0.0; for (int i=1; i<(1<<N); i++) { int cnt = 0; double sum = 0.0; for (int j=0; j<N; j++) { if (i&(1<<j)) { sum += 0.01 * p[j] * d[j] + (1.0 - 0.01 * p[j]) * res[i-(1<<j)]; cnt ++; } } res[i] = sum / cnt; ret = max(ret, res[i]); } cout << setprecision(15) << ret << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...