結果

問題 No.1009 面積の求め方
ユーザー mmn15277198
提出日時 2020-03-21 04:00:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 896 ms
コンパイル使用メモリ 77,244 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-16 07:59:40
合計ジャッジ時間 1,710 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<math.h>
#include<string.h>
#include<vector>
#include<iomanip>
using namespace std;

int main(){
	double a,b;
	cin >> a >> b;
	double sum=0;
	double x=abs(max(a,b)-min(a,b))/2;
	
	for(double i=x;;i=i-0.000001){
		sum+=abs((i-x)*(i+x))*0.000001;
		if(i<=0)break;	
	} 
	cout << fixed << setprecision(5) << sum*2 << endl;
	return 0;
}
0