結果

問題 No.1009 面積の求め方
ユーザー goto_isyuku
提出日時 2020-03-20 21:25:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 1,763 ms
コンパイル使用メモリ 166,372 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-15 03:39:15
合計ジャッジ時間 2,072 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define INT_MAX_HALF (INT_MAX / 2)
#define EPS (1e-10)

using namespace std;
typedef long long ll;

double f(double a, double b, double x){
    return 1.0 / 3 * pow(x, 3.0) - (a + b) / 2 * pow(x, 2.0) + a * b * x;
}

int main(){

    double a,b;
    cin >> a >> b;

    cout << setprecision(12) << abs(f(a, b, a) - f(a, b, b)) << endl;
}
0