Submission #1611064
Source Code Expand
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;
using ll = long long;
template<class T> using V = vector<T>;
using R = double;
int main() {
R x, y, z;
cin >> x >> y >> z;
R a = sqrt(x*x+y*y);
R th = asin(y/a);
R b = sqrt(a*a + z*z - 2*z*a * cos(2*th));
R c = a/(z+a)*b;
R d = sqrt(c*c-y*y);
R ans = x-d;
printf("%.20lf\n", ans);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - くさかべ |
| User | zenkan_rta |
| Language | C++14 (GCC 5.4.1) |
| Score | 1 |
| Code Size | 472 Byte |
| Status | AC |
| Exec Time | 3 ms |
| Memory | 384 KiB |
Judge Result
| Set Name | sample | all | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 1 / 1 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| sample | sample-01.txt, sample-02.txt |
| all | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, sample-01.txt, sample-02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-01.txt | AC | 1 ms | 256 KiB |
| 01-02.txt | AC | 1 ms | 256 KiB |
| 01-03.txt | AC | 1 ms | 256 KiB |
| 01-04.txt | AC | 1 ms | 256 KiB |
| 01-05.txt | AC | 1 ms | 256 KiB |
| 01-06.txt | AC | 3 ms | 384 KiB |
| 01-07.txt | AC | 1 ms | 256 KiB |
| 01-08.txt | AC | 1 ms | 256 KiB |
| 01-09.txt | AC | 1 ms | 256 KiB |
| 01-10.txt | AC | 1 ms | 256 KiB |
| sample-01.txt | AC | 1 ms | 256 KiB |
| sample-02.txt | AC | 1 ms | 256 KiB |