Submission #8160192


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

Int a, b, x;
constexpr double PI = 3.14159265358979;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> a >> b >> x;
	double l = 0.0, r = 90.0;
	for(Int i=0; i<100; ++i){
		double m = (l + r) / 2;
		double t = 0.0;
		if(tan(PI*m/180) > (double)b/a){
			t = a*b*b*tan(PI*(90-m)/180)/2;
		}else{
			t = a*a*b - a*a*a*tan(PI*m/180)/2;
		}
		if(t >= x + 1e-10) l = m;
		else r = m;
//		cout << i << " " << l << " " << m << " " << t << "\n";
	}
	cout << fixed << setprecision(10) << l << "\n";
}

Submission Info

Submission Time
Task D - Water Bottle
User Power730
Language C++14 (GCC 5.4.1)
Score 400
Code Size 601 Byte
Status AC
Exec Time 1 ms
Memory 384 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample00, sample01, sample02
All handmade03, handmade04, random05, random06, random07, random08, random09, random10, random11, random12, random13, random14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 AC 1 ms 384 KB
handmade04 AC 1 ms 256 KB
random05 AC 1 ms 256 KB
random06 AC 1 ms 256 KB
random07 AC 1 ms 256 KB
random08 AC 1 ms 256 KB
random09 AC 1 ms 256 KB
random10 AC 1 ms 256 KB
random11 AC 1 ms 256 KB
random12 AC 1 ms 256 KB
random13 AC 1 ms 256 KB
random14 AC 1 ms 256 KB
sample00 AC 1 ms 256 KB
sample01 AC 1 ms 256 KB
sample02 AC 1 ms 256 KB