結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー mobius_bkstmobius_bkst
提出日時 2015-05-22 22:38:34
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 793 bytes
コンパイル時間 2,787 ms
使用メモリ 34,352 KB
最終ジャッジ日時 2023-01-24 07:08:05
合計ジャッジ時間 6,019 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 52 ms
34,072 KB
testcase_01 AC 52 ms
34,352 KB
testcase_02 AC 54 ms
34,156 KB
testcase_03 AC 53 ms
34,304 KB
testcase_04 AC 53 ms
34,140 KB
testcase_05 AC 53 ms
34,208 KB
testcase_06 AC 52 ms
34,080 KB
testcase_07 AC 51 ms
34,328 KB
testcase_08 AC 53 ms
34,316 KB
testcase_09 AC 52 ms
34,260 KB
testcase_10 AC 52 ms
34,216 KB
testcase_11 AC 54 ms
34,160 KB
testcase_12 AC 52 ms
34,264 KB
testcase_13 AC 52 ms
34,264 KB
testcase_14 AC 52 ms
34,272 KB
testcase_15 AC 52 ms
34,312 KB
testcase_16 AC 51 ms
34,268 KB
testcase_17 AC 52 ms
34,312 KB
testcase_18 AC 52 ms
34,112 KB
testcase_19 AC 53 ms
34,104 KB
testcase_20 AC 51 ms
34,096 KB
testcase_21 AC 52 ms
34,304 KB
testcase_22 AC 52 ms
34,176 KB
testcase_23 AC 52 ms
34,264 KB
testcase_24 AC 51 ms
34,288 KB
testcase_25 AC 52 ms
34,232 KB
testcase_26 AC 52 ms
34,112 KB
testcase_27 AC 52 ms
34,112 KB
testcase_28 AC 52 ms
34,264 KB
testcase_29 AC 52 ms
34,264 KB
testcase_30 AC 52 ms
34,268 KB
testcase_31 AC 52 ms
34,104 KB
testcase_32 AC 52 ms
34,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class No211 {
    public static void main(String[] args) {
        try {
            int[] prime = { 2, 3, 5, 7, 11, 13 };
            int[] composite = { 4, 6, 8, 9, 10, 12 };

            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            int N = Integer.parseInt(br.readLine());
            int count = 0;
            for (int i : composite) {
                for (int j : prime) {
                    if (i * j == N) {
                        count++;
                    }
                }
            }
            System.out.println(count / 36.0);
        } catch (Exception e) {
            System.err.println("Error:" + e.getMessage());
        }
    }
}
0