結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー GrenacheGrenache
提出日時 2015-05-22 22:33:27
言語 Java19
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 473 bytes
コンパイル時間 3,239 ms
コンパイル使用メモリ 72,528 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-09-20 09:30:54
合計ジャッジ時間 5,286 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,016 KB
testcase_01 AC 125 ms
55,736 KB
testcase_02 AC 124 ms
56,000 KB
testcase_03 AC 125 ms
56,328 KB
testcase_04 AC 125 ms
55,732 KB
testcase_05 AC 125 ms
55,844 KB
testcase_06 AC 122 ms
55,724 KB
testcase_07 AC 123 ms
56,012 KB
testcase_08 AC 127 ms
56,060 KB
testcase_09 AC 127 ms
56,044 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