Submission #8165857


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
#define N 1000005
#define eps 1e-10
#define Pi acos(-1.0)
int n,m,len;
int a[N];
bool f[N];
char s[N];
int main()
{
	int T=1;
	//scanf("%d",&T);
	while(T--)
	{
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		n=a*a*b;
		if(n>=2*c)
		{
			double c1=c*2.0/b/a;
			double l=-eps,r=90.0+eps;
			while(l+eps<r)
			{
				double mid=(l+r)/2;
				if(b*cos((90-mid)/180*Pi)<=c1*cos(mid/180*Pi))
					l=mid;
				else
					r=mid;
			}
			printf("%.10f",90-l);
		}
		else
		{
			double c1=c*2.0/a/a-b;
			c1=b-c1;
			double l=-eps,r=90.0+eps;
			while(l+eps<r)
			{
				double mid=(l+r)/2;
				if(c1*cos((90-mid)/180*Pi)<=a*cos(mid/180*Pi))
					l=mid;
				else
					r=mid;
			}
			printf("%.10f",90-l);
		}
	}
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:17:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d%d",&a,&b,&c);
                           ^

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 256 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 3 ms 384 KB
sample00 AC 1 ms 256 KB
sample01 AC 1 ms 256 KB
sample02 AC 1 ms 256 KB