結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー k_kadorak_kadora
提出日時 2015-06-10 22:12:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 1,000 ms
コード長 370 bytes
コンパイル時間 3,172 ms
コンパイル使用メモリ 72,380 KB
実行使用メモリ 56,548 KB
最終ジャッジ日時 2023-09-08 05:14:15
合計ジャッジ時間 8,616 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,784 KB
testcase_01 AC 120 ms
55,380 KB
testcase_02 AC 121 ms
54,140 KB
testcase_03 AC 119 ms
56,304 KB
testcase_04 AC 120 ms
55,820 KB
testcase_05 AC 121 ms
55,632 KB
testcase_06 AC 127 ms
55,828 KB
testcase_07 AC 127 ms
55,424 KB
testcase_08 AC 128 ms
55,764 KB
testcase_09 AC 124 ms
55,432 KB
testcase_10 AC 125 ms
55,608 KB
testcase_11 AC 126 ms
55,588 KB
testcase_12 AC 124 ms
55,920 KB
testcase_13 AC 123 ms
55,884 KB
testcase_14 AC 124 ms
55,936 KB
testcase_15 AC 123 ms
55,992 KB
testcase_16 AC 122 ms
55,688 KB
testcase_17 AC 126 ms
56,548 KB
testcase_18 AC 122 ms
56,260 KB
testcase_19 AC 120 ms
56,164 KB
testcase_20 AC 127 ms
55,644 KB
testcase_21 AC 122 ms
55,800 KB
testcase_22 AC 123 ms
55,480 KB
testcase_23 AC 124 ms
55,788 KB
testcase_24 AC 128 ms
56,204 KB
testcase_25 AC 127 ms
55,632 KB
testcase_26 AC 125 ms
55,684 KB
testcase_27 AC 125 ms
55,412 KB
testcase_28 AC 125 ms
55,924 KB
testcase_29 AC 127 ms
55,980 KB
testcase_30 AC 125 ms
55,728 KB
testcase_31 AC 126 ms
55,944 KB
testcase_32 AC 124 ms
56,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Dice2{
	public static void main(String[] arg){
		int[] dice1 = {2,3,5,7,11,13};
		int[] dice2 = {4,6,8,9,10,12};
		int k,sum=0;
		Scanner sc = new Scanner(System.in);
		k = sc.nextInt();
		for(int i = 0;i<6;i++){
			for(int j = 0; j<6;j++){
				if(dice1[i]*dice2[j] == k)sum++;
			}
		}
		System.out.println((double)sum/36.0);
	}
}
0