Submission #15679

# Submission time Handle Problem Language Result Execution time Memory
15679 2015-07-15T00:55:11 Z baneling100 맛있는 과자 (kriii3_A) C++
0 / 33
0 ms 1192 KB
#include <stdio.h>
#include <math.h>

int N;
double A, B;
long long K;

int main(void) {

    int i;
    long long u=1;
    double Sa, Sb, A1, B1, H, temp;

    scanf("%lf %lf %d %lld",&A,&B,&N,&K);
    for(i=1 ; i<=N ; i++) u<<=1;
    for(i=1 ; i<=N ; i++) {
        u>>=1;
        Sa=A*A*A*B/2.0/(A*A+B*B);
        Sb=A*B*B*B/2.0/(A*A+B*B);
        A1=A*A/sqrt(A*A+B*B);
        B1=B*B/sqrt(A*A+B*B);
        H=A*B/sqrt(A*A+B*B);
        if(Sa>Sb) {
            temp=Sa;
            Sa=Sb;
            Sb=temp;
            temp=A1;
            A1=B1;
            B1=temp;
        }
        if(K<=u) {
            A=H;
            B=B1;
        }
        else {
            K-=u;
            A=A1;
            B=H;
        }
    }
    printf("%.12lf",log(A*B/2.0));

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1192 KB Output is correct
2 Incorrect 0 ms 1192 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -