結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー jimanojimano
提出日時 2018-01-20 13:33:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 760 bytes
コンパイル時間 4,268 ms
コンパイル使用メモリ 72,220 KB
実行使用メモリ 50,152 KB
最終ジャッジ日時 2023-09-08 06:29:31
合計ジャッジ時間 6,978 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,756 KB
testcase_01 AC 43 ms
49,740 KB
testcase_02 AC 44 ms
49,908 KB
testcase_03 AC 45 ms
49,856 KB
testcase_04 AC 46 ms
49,896 KB
testcase_05 AC 46 ms
49,836 KB
testcase_06 AC 46 ms
49,500 KB
testcase_07 AC 45 ms
49,700 KB
testcase_08 AC 44 ms
50,152 KB
testcase_09 AC 44 ms
49,780 KB
testcase_10 AC 45 ms
49,592 KB
testcase_11 AC 45 ms
49,860 KB
testcase_12 AC 45 ms
49,764 KB
testcase_13 AC 45 ms
49,808 KB
testcase_14 AC 46 ms
49,840 KB
testcase_15 AC 47 ms
49,720 KB
testcase_16 AC 46 ms
49,744 KB
testcase_17 AC 45 ms
49,904 KB
testcase_18 AC 45 ms
50,036 KB
testcase_19 AC 48 ms
49,752 KB
testcase_20 AC 45 ms
49,924 KB
testcase_21 AC 44 ms
49,748 KB
testcase_22 AC 45 ms
49,808 KB
testcase_23 AC 46 ms
49,776 KB
testcase_24 AC 45 ms
49,756 KB
testcase_25 AC 45 ms
49,792 KB
testcase_26 AC 45 ms
49,828 KB
testcase_27 AC 45 ms
49,724 KB
testcase_28 AC 44 ms
49,736 KB
testcase_29 AC 44 ms
49,704 KB
testcase_30 AC 44 ms
49,856 KB
testcase_31 AC 45 ms
49,588 KB
testcase_32 AC 45 ms
49,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.RoundingMode;

public class No0211 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
			int K = Integer.parseInt(br.readLine());
			int[] prime = { 2, 3, 5, 7, 11, 13 };
			int[] composite = { 4, 6, 8, 9, 10, 12 };
			int cnt = 0;
			BigDecimal ans;

			for (int p : prime) {
				for (int c : composite) {
					if (p * c == K)
						cnt++;
				}
			}
			ans = new BigDecimal((double)cnt/36).setScale(12, RoundingMode.HALF_UP);

			System.out.println(ans);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0