Submission #1385803
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define fi first #define se second template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; } template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; } typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<int, pll> pip; const ll INF = 1ll<<30; const ll MOD = 1000000007; const double EPS = 1e-8; int main() { double a, b, c; cin >> a >> b >> c; double l = 0.0, r = 10000; REP(i, 100) { double m = (l + r) / 2; double ft = a * m + b * sin(c * m * acos(-1)); if (ft >= 100) r = m; else l = m; } printf("%.15f\n", r); return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - 高橋君ボール1号 |
User | tkmst201 |
Language | C++14 (GCC 5.4.1) |
Score | 100 |
Code Size | 873 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 768 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 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 | 6 ms | 768 KB |
example_1.txt | AC | 1 ms | 256 KB |
random_0.txt | AC | 1 ms | 256 KB |
random_1.txt | AC | 1 ms | 256 KB |
random_2.txt | AC | 1 ms | 256 KB |
random_3.txt | AC | 1 ms | 256 KB |
random_4.txt | AC | 1 ms | 256 KB |
random_5.txt | AC | 1 ms | 256 KB |
random_6.txt | AC | 1 ms | 256 KB |
random_7.txt | AC | 1 ms | 256 KB |
random_8.txt | AC | 1 ms | 256 KB |
random_9.txt | AC | 1 ms | 256 KB |
special_0.txt | AC | 1 ms | 256 KB |
special_1.txt | AC | 1 ms | 256 KB |
special_2.txt | AC | 1 ms | 256 KB |