結果
| 問題 |
No.724 円と円の間の円
|
| コンテスト | |
| ユーザー |
tomato
|
| 提出日時 | 2018-08-03 22:44:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 389 bytes |
| コンパイル時間 | 584 ms |
| コンパイル使用メモリ | 63,572 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 17:32:35 |
| 合計ジャッジ時間 | 1,282 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int n;
double a, b;
cin >> n >> a >> b;
double r = (0.5 / a - 0.5 / b) * 0.5;
double x = (0.5 / a + 0.5 / b) * 0.5;
double y = (n - 1) * r;
double d1 = hypot(x, y) - r;
double d2 = hypot(x, y) + r;
double ans = 1 / d1 - 1 / d2;
printf("%.20f\n", ans / 2);
}
tomato