結果
問題 |
No.89 どんどんドーナツどーんといこう!
|
ユーザー |
|
提出日時 | 2018-02-10 15:22:06 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 52 ms / 5,000 ms |
コード長 | 838 bytes |
コンパイル時間 | 2,805 ms |
コンパイル使用メモリ | 75,260 KB |
実行使用メモリ | 51,016 KB |
最終ジャッジ日時 | 2024-10-05 23:22:48 |
合計ジャッジ時間 | 3,912 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 |
ソースコード
package me.yukicoder.lv1_5; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.math.RoundingMode; public class No0089 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int cal = Integer.parseInt(br.readLine()); String[] r = br.readLine().split(" "); int[] round = {Integer.parseInt(r[0]), Integer.parseInt(r[1])}; double calorie = calcVolume(round[0], round[1]) * cal; System.out.println(new BigDecimal(calorie).setScale(5, RoundingMode.HALF_EVEN)); } static double calcVolume(int roundIn, int roundOut) { double rad = (roundOut - roundIn) / 2.0; double Rad = roundOut - rad; return 2 * Math.pow(Math.PI, 2.0) * Math.pow(rad, 2.0) * Rad; } }