# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15323 |
2015-07-12T05:59:57 Z |
seirion |
맛있는 과자 (kriii3_A) |
C++14 |
|
0 ms |
1836 KB |
#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 |
1 |
Correct |
0 ms |
1836 KB |
Output is correct |
2 |
Correct |
0 ms |
1836 KB |
Output is correct |
3 |
Correct |
0 ms |
1836 KB |
Output is correct |
4 |
Correct |
0 ms |
1836 KB |
Output is correct |
5 |
Incorrect |
0 ms |
1836 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |