結果
| 問題 | No.1487 ぺんぎんさんかっけー | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-04-23 22:10:11 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 702 bytes | 
| コンパイル時間 | 1,008 ms | 
| コンパイル使用メモリ | 98,216 KB | 
| 最終ジャッジ日時 | 2025-01-20 23:57:12 | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 37 | 
ソースコード
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
using ldouble = long double;
void solve() {
    vector<ldouble> xs(3);
    for (auto& x : xs) cin >> x;
    auto theta = [&]() {
        return acos((xs[2] * xs[2] - xs[0] * xs[0] - xs[1] * xs[1]) / (xs[0] * xs[1] * 2));
    };
    auto s = xs[0] * xs[1] * sin(theta()) / 2;
    for (int i = 0; i < 3; ++i) {
        s -= xs[0] * xs[1] * sin(theta()) / 8;
        rotate(xs.begin(), xs.begin() + 1, xs.end());
    }
    cout << s << "\n";
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    solve();
    return 0;
}
            
            
            
        