結果
| 問題 |
No.1009 面積の求め方
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-05 19:48:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 296 bytes |
| コンパイル時間 | 598 ms |
| コンパイル使用メモリ | 69,464 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 19:10:40 |
| 合計ジャッジ時間 | 1,478 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 |
ソースコード
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
double a, b;
cin >> a >> b;
if(a > b) swap(a, b);
auto f = [&](double x){
return 1.0/3.0*x*x*x-(a+b)/2*x*x+a*b*x;
};
cout << fixed << setprecision(12) << -(f(b)-f(a)) << endl;
return 0;
}