結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー htensaihtensai
提出日時 2019-12-17 16:21:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 1,876 ms
コンパイル使用メモリ 71,664 KB
実行使用メモリ 49,972 KB
最終ジャッジ日時 2023-09-17 00:03:20
合計ジャッジ時間 2,949 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,772 KB
testcase_01 AC 41 ms
49,780 KB
testcase_02 AC 41 ms
49,428 KB
testcase_03 AC 42 ms
49,260 KB
testcase_04 AC 40 ms
49,416 KB
testcase_05 AC 42 ms
49,460 KB
testcase_06 AC 41 ms
49,496 KB
testcase_07 AC 40 ms
47,596 KB
testcase_08 AC 42 ms
49,972 KB
testcase_09 AC 41 ms
49,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] first = br.readLine().split(" ", 2);
        int p = Integer.parseInt(first[0]);
        int c = Integer.parseInt(first[1]);
        int[] pArr = new int[]{2,3,5,7,11,13};
        int[] cArr = new int[]{4,6,8,9,10,12};
        double pEx = 0;
        double cEx = 0;
        for (int i = 0; i < 6; i++) {
            pEx += pArr[i] / 6.0;
            cEx += cArr[i] / 6.0;
        }
        System.out.println(Math.pow(pEx, p) * Math.pow(cEx, c));
    }
}
0