結果

問題 No.1009 面積の求め方
ユーザー ks2mks2m
提出日時 2020-03-20 21:24:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 3,406 ms
コンパイル使用メモリ 71,548 KB
実行使用メモリ 49,668 KB
最終ジャッジ日時 2023-08-21 14:55:55
合計ジャッジ時間 4,536 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,140 KB
testcase_01 AC 41 ms
49,440 KB
testcase_02 AC 45 ms
47,272 KB
testcase_03 AC 45 ms
49,176 KB
testcase_04 AC 41 ms
49,668 KB
testcase_05 AC 40 ms
49,068 KB
testcase_06 AC 45 ms
49,460 KB
testcase_07 AC 45 ms
49,332 KB
testcase_08 AC 44 ms
49,480 KB
testcase_09 AC 45 ms
49,596 KB
testcase_10 AC 45 ms
49,028 KB
testcase_11 AC 44 ms
49,524 KB
testcase_12 AC 45 ms
49,244 KB
testcase_13 AC 45 ms
49,444 KB
testcase_14 AC 45 ms
49,428 KB
testcase_15 AC 44 ms
49,372 KB
testcase_16 AC 45 ms
49,200 KB
testcase_17 AC 45 ms
49,552 KB
testcase_18 AC 46 ms
49,408 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