結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー spaciaspacia
提出日時 2016-01-04 20:36:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 750 bytes
コンパイル時間 2,145 ms
コンパイル使用メモリ 75,860 KB
実行使用メモリ 53,976 KB
最終ジャッジ日時 2023-10-19 15:07:32
合計ジャッジ時間 3,443 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
52,864 KB
testcase_01 AC 58 ms
53,960 KB
testcase_02 AC 58 ms
53,976 KB
testcase_03 AC 57 ms
53,952 KB
testcase_04 AC 57 ms
53,972 KB
testcase_05 AC 58 ms
53,976 KB
testcase_06 AC 58 ms
53,960 KB
testcase_07 AC 60 ms
53,952 KB
testcase_08 AC 58 ms
53,972 KB
testcase_09 AC 60 ms
53,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String[] line = br.readLine().split(" ");
		int p = Integer.parseInt(line[0]);
		int c = Integer.parseInt(line[1]);
		
		BigDecimal ans = BigDecimal.ONE;
		BigDecimal d1 = new BigDecimal("6.8333333333333333333");
		BigDecimal d2 = new BigDecimal("8.1666666666666666666");
		
		if (p > 0) ans = ans.multiply(d1.pow(p).setScale(15 , BigDecimal.ROUND_HALF_UP));
		if (c > 0) ans = ans.multiply(d2.pow(c).setScale(15 , BigDecimal.ROUND_HALF_UP));
		
		out(ans);
	}
}
0