結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー yagi2yagi2
提出日時 2017-04-21 12:48:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 491 bytes
コンパイル時間 4,413 ms
コンパイル使用メモリ 71,564 KB
実行使用メモリ 56,012 KB
最終ジャッジ日時 2023-09-08 06:16:12
合計ジャッジ時間 10,103 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,672 KB
testcase_01 AC 122 ms
55,672 KB
testcase_02 AC 127 ms
55,448 KB
testcase_03 AC 125 ms
55,712 KB
testcase_04 AC 123 ms
55,624 KB
testcase_05 AC 123 ms
55,768 KB
testcase_06 AC 123 ms
55,636 KB
testcase_07 AC 122 ms
55,612 KB
testcase_08 AC 122 ms
55,752 KB
testcase_09 AC 122 ms
55,752 KB
testcase_10 AC 122 ms
55,644 KB
testcase_11 AC 122 ms
55,780 KB
testcase_12 AC 123 ms
55,736 KB
testcase_13 AC 122 ms
55,520 KB
testcase_14 AC 123 ms
56,012 KB
testcase_15 AC 122 ms
55,468 KB
testcase_16 AC 122 ms
55,600 KB
testcase_17 AC 124 ms
55,616 KB
testcase_18 AC 126 ms
55,380 KB
testcase_19 AC 123 ms
55,984 KB
testcase_20 AC 125 ms
55,440 KB
testcase_21 AC 126 ms
53,772 KB
testcase_22 AC 122 ms
55,668 KB
testcase_23 AC 123 ms
55,396 KB
testcase_24 AC 124 ms
55,392 KB
testcase_25 AC 126 ms
55,772 KB
testcase_26 AC 126 ms
55,804 KB
testcase_27 AC 125 ms
55,740 KB
testcase_28 AC 123 ms
55,640 KB
testcase_29 AC 122 ms
55,672 KB
testcase_30 AC 123 ms
55,572 KB
testcase_31 AC 124 ms
55,384 KB
testcase_32 AC 122 ms
53,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

        int K = Integer.parseInt(sc.next());

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

        for (int i = 0; i < 6; i++) {
            for (int j = 0; j < 6; j++) {
                if (dice[0][i] * dice[1][j] == K) sum++;
            }
        }

        System.out.println((double)sum / 36);
    }
}
0