이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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); k--;
ccc[(double)a*b/2] = 1;
while (n--) {
cut();
}
double r;
int64 acc = 0;
for (auto x = ccc.rbegin(); x != ccc.rend(); x++) {
//printf("::: %0.10f\n", log(x->first));
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... |