Submission #1190398
Source Code Expand
#include<iostream> #include<cmath> #include<iomanip> using namespace std; const double p=3.1415926535897932384626; const double EPS=1e-11; double a,b,c; double f(double t) { return a*t+b*sin(c*t*p); } main() { double x=0.0,y=250.0; cin>>a>>b>>c; for(int i=0;i<1000;i++) { double m=(x+y)/2; double s=f(m); if(s>100-EPS&&s<100+EPS) { cout<<fixed<<setprecision(9)<<m<<endl; return 0; } else if(s>=100+b)y=m; else if(s<=100-b)x=m; else if(s>=100) { y=m; } else { x=m; } } cout<<fixed<<setprecision(9)<<x<<endl; }
Submission Info
Submission Time | |
---|---|
Task | D - 高橋君ボール1号 |
User | kotatsugame |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 591 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example_0.txt, example_1.txt |
All | example_0.txt, example_1.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, special_0.txt, special_1.txt, special_2.txt, example_0.txt, example_1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
example_0.txt | AC | 1 ms | 256 KB |
example_1.txt | AC | 1 ms | 256 KB |
random_0.txt | AC | 1 ms | 256 KB |
random_1.txt | WA | 1 ms | 256 KB |
random_2.txt | WA | 1 ms | 256 KB |
random_3.txt | AC | 1 ms | 256 KB |
random_4.txt | WA | 1 ms | 256 KB |
random_5.txt | AC | 1 ms | 256 KB |
random_6.txt | AC | 1 ms | 256 KB |
random_7.txt | WA | 1 ms | 256 KB |
random_8.txt | WA | 1 ms | 256 KB |
random_9.txt | AC | 1 ms | 256 KB |
special_0.txt | WA | 1 ms | 256 KB |
special_1.txt | WA | 1 ms | 256 KB |
special_2.txt | AC | 1 ms | 256 KB |