結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 14:43:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 857 bytes
コンパイル時間 2,667 ms
コンパイル使用メモリ 71,028 KB
実行使用メモリ 49,536 KB
最終ジャッジ日時 2023-09-08 06:16:18
合計ジャッジ時間 4,974 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,208 KB
testcase_01 AC 44 ms
49,120 KB
testcase_02 AC 44 ms
49,064 KB
testcase_03 AC 44 ms
49,248 KB
testcase_04 AC 44 ms
49,340 KB
testcase_05 AC 44 ms
49,376 KB
testcase_06 AC 45 ms
49,240 KB
testcase_07 AC 44 ms
47,140 KB
testcase_08 AC 43 ms
49,224 KB
testcase_09 AC 45 ms
49,360 KB
testcase_10 AC 44 ms
49,032 KB
testcase_11 AC 44 ms
49,292 KB
testcase_12 AC 45 ms
49,348 KB
testcase_13 AC 44 ms
49,344 KB
testcase_14 AC 43 ms
49,256 KB
testcase_15 AC 44 ms
49,480 KB
testcase_16 AC 45 ms
49,152 KB
testcase_17 AC 45 ms
49,380 KB
testcase_18 AC 46 ms
49,260 KB
testcase_19 AC 45 ms
49,292 KB
testcase_20 AC 44 ms
49,292 KB
testcase_21 AC 45 ms
49,300 KB
testcase_22 AC 45 ms
49,252 KB
testcase_23 AC 44 ms
49,164 KB
testcase_24 AC 44 ms
49,124 KB
testcase_25 AC 45 ms
49,484 KB
testcase_26 AC 45 ms
49,128 KB
testcase_27 AC 45 ms
49,084 KB
testcase_28 AC 44 ms
49,316 KB
testcase_29 AC 45 ms
49,016 KB
testcase_30 AC 44 ms
49,536 KB
testcase_31 AC 46 ms
49,364 KB
testcase_32 AC 45 ms
49,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import static java.lang.System.in;


public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        int K = Integer.parseInt(reader.readLine());
        int[] primes = new int[]{2, 3, 5, 7, 11, 13};
        int[] composites = new int[]{4, 6, 8, 9, 10, 12};
        double totalCombinations = 36;
        int counter = 0;
        for (int i = 0; i < 6; i++) {
            int x = primes[i];
            for (int j = 0; j < 6; j++) {
                int y = composites[j];
                if ((K%x) == 0 && y == K / x) {
                    counter+=1;
                }
            }
        }
        System.out.println(counter/totalCombinations);
    }
}
0