Submission #15324

#TimeUsernameProblemLanguageResultExecution timeMemory
15324seirion맛있는 과자 (kriii3_A)C++14
33 / 33
6 ms2496 KiB
#include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <map> #include <algorithm> #include <functional> using namespace std; typedef long long int64; map<double, pair<double, double> > m; map<double, int64> ccc; int64 a, b, n, k; double dev; void cut() { vector<double> temp; map<double, int64> tm; for (auto x : ccc) { double d = x.first; int64 count = x.second; if (m.find(d) == m.end()) { auto x = make_pair(d*a*a/dev/dev, d*b*b/dev/dev); tm[x.first] += count; tm[x.second] += count; m[d] = x; } else{ auto x = m[d]; tm[x.first] += count; tm[x.second] += count; } } ccc.swap(tm); } int main() { cin >> a >> b >> n >> k; dev = sqrt(a*a + b*b); ccc[(double)a*b/2] = 1; while (n--) { cut(); } double r; int64 acc = 0; for (auto x = ccc.rbegin(); x != ccc.rend(); x++) { acc += x->second; if (acc >= k) { printf("%0.10f\n", log(x->first)); break; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...