結果
問題 | No.89 どんどんドーナツどーんといこう! |
ユーザー | jimano |
提出日時 | 2018-02-10 15:22:06 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 60 ms / 5,000 ms |
コード長 | 838 bytes |
コンパイル時間 | 3,363 ms |
コンパイル使用メモリ | 75,072 KB |
実行使用メモリ | 37,608 KB |
最終ジャッジ日時 | 2024-04-15 19:48:58 |
合計ジャッジ時間 | 4,628 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 57 ms
37,120 KB |
testcase_01 | AC | 58 ms
37,608 KB |
testcase_02 | AC | 56 ms
37,552 KB |
testcase_03 | AC | 60 ms
37,324 KB |
testcase_04 | AC | 56 ms
37,260 KB |
testcase_05 | AC | 58 ms
37,196 KB |
testcase_06 | AC | 57 ms
37,260 KB |
testcase_07 | AC | 57 ms
37,380 KB |
testcase_08 | AC | 56 ms
37,428 KB |
testcase_09 | AC | 56 ms
37,272 KB |
testcase_10 | AC | 57 ms
37,428 KB |
ソースコード
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; } }