結果

問題 No.1009 面積の求め方
ユーザー ks2mks2m
提出日時 2020-03-20 21:24:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 2,691 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 37,036 KB
最終ジャッジ日時 2024-05-08 20:23:34
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,764 KB
testcase_01 AC 48 ms
36,868 KB
testcase_02 AC 52 ms
36,656 KB
testcase_03 AC 51 ms
36,916 KB
testcase_04 AC 46 ms
36,660 KB
testcase_05 AC 47 ms
36,760 KB
testcase_06 AC 50 ms
36,960 KB
testcase_07 AC 49 ms
36,672 KB
testcase_08 AC 51 ms
37,036 KB
testcase_09 AC 52 ms
36,920 KB
testcase_10 AC 50 ms
36,668 KB
testcase_11 AC 49 ms
36,652 KB
testcase_12 AC 51 ms
36,672 KB
testcase_13 AC 49 ms
36,896 KB
testcase_14 AC 50 ms
36,672 KB
testcase_15 AC 51 ms
36,936 KB
testcase_16 AC 50 ms
36,656 KB
testcase_17 AC 50 ms
36,952 KB
testcase_18 AC 52 ms
36,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int a = Integer.parseInt(sa[0]);
		int b = Integer.parseInt(sa[1]);
		br.close();

		if (a == b) {
			System.out.println(0);
			return;
		}

		double ans = 0;
		double eps = (b - a) / 100000.0;
		for (double i = a; i < b; i+=eps) {
			ans -= (i - a) * (i - b) * eps;
		}
		System.out.println(ans);
	}
}
0