Submission #8239260
Source Code Expand
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323846
inline void rd(double &x){
scanf("%lf",&x);
}
inline void wt_L(char a){
putchar_unlocked(a);
}
inline void wt_L(int x){
int s=0;
int m=0;
char f[10];
if(x<0){
m=1;
x=-x;
}
while(x){
f[s++]=x%10;
x/=10;
}
if(!s){
f[s++]=0;
}
if(m){
putchar_unlocked('-');
}
while(s--){
putchar_unlocked(f[s]+'0');
}
}
inline void wt_L(unsigned x){
int s=0;
char f[10];
while(x){
f[s++]=x%10;
x/=10;
}
if(!s){
f[s++]=0;
}
while(s--){
putchar_unlocked(f[s]+'0');
}
}
inline void wt_L(long long x){
int s=0;
int m=0;
char f[20];
if(x<0){
m=1;
x=-x;
}
while(x){
f[s++]=x%10;
x/=10;
}
if(!s){
f[s++]=0;
}
if(m){
putchar_unlocked('-');
}
while(s--){
putchar_unlocked(f[s]+'0');
}
}
inline void wt_L(unsigned long long x){
int s=0;
char f[21];
while(x){
f[s++]=x%10;
x/=10;
}
if(!s){
f[s++]=0;
}
while(s--){
putchar_unlocked(f[s]+'0');
}
}
inline void wt_L(double x){
printf("%.15f",x);
}
inline void wt_L(const char c[]){
int i=0;
for(i=0;c[i]!='\0';i++){
putchar_unlocked(c[i]);
}
}
inline void wt_L(string &x){
int i=0;
for(i=0;x[i]!='\0';i++){
putchar_unlocked(x[i]);
}
}
double A;
double B;
double X;
int main(){
rd(A);
rd(B);
rd(X);
X /= A;
if(X >= A*B/2){
wt_L((atan2(A*B-X,A*A/2)) * 180 / PI);
wt_L('\n');
}
else{
wt_L((PI/2-atan2(X,B*B/2)) * 180 / PI);
wt_L('\n');
}
return 0;
}
// cLay varsion 20191027-1
// --- original code ---
// double A, B, X;
// {
// rd(A,B,X);
// X /= A;
// wt( (if[X >= A*B/2, atan2(A*B-X,A*A/2), PI/2-atan2(X,B*B/2)]) * 180 / PI );
// }
Submission Info
| Submission Time | |
|---|---|
| Task | D - Water Bottle |
| User | LayCurse |
| Language | C++14 (GCC 5.4.1) |
| Score | 400 |
| Code Size | 1921 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Compile Error
./Main.cpp: In function ‘void rd(double&)’:
./Main.cpp:6:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lf",&x);
^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 400 | ||||
| Status |
|
|
| 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 KiB |
| handmade04 | AC | 1 ms | 256 KiB |
| random05 | AC | 1 ms | 256 KiB |
| random06 | AC | 1 ms | 256 KiB |
| random07 | AC | 1 ms | 256 KiB |
| random08 | AC | 1 ms | 256 KiB |
| random09 | AC | 1 ms | 256 KiB |
| random10 | AC | 1 ms | 256 KiB |
| random11 | AC | 1 ms | 256 KiB |
| random12 | AC | 1 ms | 256 KiB |
| random13 | AC | 1 ms | 256 KiB |
| random14 | AC | 1 ms | 256 KiB |
| sample00 | AC | 1 ms | 256 KiB |
| sample01 | AC | 1 ms | 256 KiB |
| sample02 | AC | 1 ms | 256 KiB |