結果
| 問題 |
No.1319 最強とんがりコーン
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2020-12-16 03:56:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,206 ms / 2,000 ms |
| コード長 | 731 bytes |
| コンパイル時間 | 4,491 ms |
| コンパイル使用メモリ | 221,084 KB |
| 最終ジャッジ日時 | 2025-01-17 01:50:10 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 70 |
ソースコード
#include <boost/math/constants/constants.hpp>
#include <boost/math/quadrature/gauss.hpp>
#include <cmath>
#include <iostream>
int main() {
double R, H, D;
std::cin >> R >> H >> D;
auto r = [=](const double& y) {
return R * y / H;
};
auto t = [=](const double& y) {
auto r_y = r(y);
return boost::math::constants::pi<double>() - std::acos(1.0 - D * D / (2.0 * r_y * r_y));
};
auto s = [=](const double& y) {
auto r_y = r(y);
auto t_y = t(y);
return r_y * r_y * (t_y - std::sin(t_y));
};
double a = H * D / (2.0 * R);
double b = H;
double ans = boost::math::quadrature::gauss<double, 10000>::integrate(s, a, b);
std::cout << std::fixed << std::setprecision(10) << ans << std::endl;
}
くれちー