# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15335 |
2015-07-12T06:19:01 Z |
jeapi |
맛있는 과자 (kriii3_A) |
C++ |
|
0 ms |
1828 KB |
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a, b, N;
long long T,K;
cin >> a >> b >> N >> K;
if (a > b){
int t = a;
a = b;
b = t;
}
double S = (a*b);
S = log(S/2);
a = a*a;
b = b*b;
double A = ((double)a / (double)(a + b));
double B = ((double)b / (double)(a + b));
A = log(A);
B = log(B);
T = 1;
for (int i = 0; i < N; i++){
T *= 2;
}
while (T > 1){
T = T / 2;
if (K<=T){
S += B;
}
else{
K = K - T;
S += A;
}
}
printf("%.10f", S);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1828 KB |
Output is correct |
2 |
Incorrect |
0 ms |
1828 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |