This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |