Submission #15454

# Submission time Handle Problem Language Result Execution time Memory
15454 2015-07-12T07:58:22 Z yukariko 맛있는 과자 (kriii3_A) C++
0 / 33
0 ms 1828 KB
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;

double A,B,C,L;
double AA,BB;
int N;
long long K;


int main()
{
	cin >> A >> B >> N >> K;
	
	for(int i=N-1; i >= 0; i--)
	{
		C = sqrt(A*A+B*B);
		L = A * B / C;
		AA = sqrt(A * A - L * L);
		BB = C - AA;
		
		if((1LL << i) >= K)
		{
			if(AA < BB)
			{
				A = L;
				B = BB;	
			}
			else
			{
				A = L;
				B = AA;
			}
		}
		else
		{
			if(AA < BB)
			{
				A = L;
				B = AA;
			}
			else
			{
				A = L;
				B = BB;
			}
			K -= 1LL << i;
		}
	}
	printf("%.12f",log(A*B/2));
	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 -