結果

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

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 99 ms
37,772 KB
testcase_01 AC 95 ms
37,584 KB
testcase_02 AC 99 ms
37,648 KB
testcase_03 AC 93 ms
37,548 KB
testcase_04 AC 93 ms
37,828 KB
testcase_05 AC 95 ms
37,556 KB
testcase_06 AC 94 ms
37,664 KB
testcase_07 AC 94 ms
37,620 KB
testcase_08 AC 93 ms
37,552 KB
testcase_09 AC 92 ms
37,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no212;

import java.util.Scanner;

public class Main {
	public static int[] d1 = {2,3,5,7,11,13};
	public static int[] d2 = {4,6,8,9,10,12};
	public static void main(String[] args) {
		double e1 = 0,e2 = 0;
		for(int i=0;i<6;i++) {
			e1 += d1[i];
			e2 += d2[i];
		}
		e1 /= 6;
		e2 /= 6;
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		int c = sc.nextInt();
		System.out.println(Math.pow(e1,p) * Math.pow(e2, c));
	}

}
0