結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー GrenacheGrenache
提出日時 2015-05-22 22:33:27
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 99 ms / 5,000 ms
コード長 473 bytes
コンパイル時間 3,025 ms
使用メモリ 37,848 KB
最終ジャッジ日時 2023-02-08 18:26:57
合計ジャッジ時間 5,110 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 99 ms
37,768 KB
testcase_01 AC 95 ms
37,848 KB
testcase_02 AC 93 ms
37,688 KB
testcase_03 AC 93 ms
37,708 KB
testcase_04 AC 99 ms
37,768 KB
testcase_05 AC 97 ms
37,496 KB
testcase_06 AC 98 ms
37,552 KB
testcase_07 AC 95 ms
37,756 KB
testcase_08 AC 96 ms
37,732 KB
testcase_09 AC 95 ms
37,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main_yukicoder212 {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int p = sc.nextInt();
		int c = sc.nextInt();

		int[] d1 = {2, 3, 5, 7, 11, 13};
		int[] d2 = {4, 6, 8, 9, 10, 12};

		double e1 = 0;
		double e2 = 0;
		for (int i = 0; i < 6; i++) {
			e1 += (double)d1[i] / 6;
			e2 += (double)d2[i] / 6;
		}
		
		System.out.println(Math.pow(e1, p) * Math.pow(e2,  c));
		
		sc.close();
	}
}
0