結果

問題 No.1009 面積の求め方
ユーザー Y17Y17
提出日時 2020-03-20 21:28:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 441 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 1,513 ms
コンパイル使用メモリ 163,240 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-21 15:10:50
合計ジャッジ時間 6,078 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 113 ms
4,376 KB
testcase_03 AC 441 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 222 ms
4,376 KB
testcase_07 AC 178 ms
4,376 KB
testcase_08 AC 158 ms
4,376 KB
testcase_09 AC 46 ms
4,380 KB
testcase_10 AC 68 ms
4,380 KB
testcase_11 AC 92 ms
4,380 KB
testcase_12 AC 203 ms
4,380 KB
testcase_13 AC 248 ms
4,380 KB
testcase_14 AC 288 ms
4,376 KB
testcase_15 AC 371 ms
4,376 KB
testcase_16 AC 413 ms
4,376 KB
testcase_17 AC 264 ms
4,380 KB
testcase_18 AC 396 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }


double aa, bb;

double f(double x){
	return (x-aa)*(x-bb);
}

signed main(){
	int a, b;
	cin >> a >> b;
	aa = a;
	bb = b;

	double ans = 0;

	for(double i = a;i <= b;i+=1e-7){
		double tmp = -f(i);
		if(tmp >= 0){
			ans += tmp * (1e-7);
		}
	}

	printf("%.12lf\n", ans);

	return 0;
}
0